According to Bjarne Stroustrup, you should use const for variables and inline for functions. These are the exact same things that macros are used for in C, but without the same controls. For example, C++ will do type checking on a const variable, but not on a macro. I've seen the same advice in other books about C++. Basicly, macros should be the tool of last resort, not part of a tutorial with an eager introduction.
|