C++ macros with define or inline? -
possible duplicate:
inline functions vs preprocessor macros
inline functions introduced in c++ replace c style macros (#define macroname...), still, see lots of c++ code using old c style macros rather inlined functions, inlined function inferior old c style macros?
i macros inferior inlined functions.
inlined functions type safe , macros not. that's big advantage of them. compiler helping make better code.
with said, there few things macros can functions cannot. there not many of these things though...
i believe c programmers used macros , continue habits c++.
Comments
Post a Comment