|Synopsis:||Do not use the preprocessor directive #define to obtain more efficient code; instead, use inline or template methods/functions|
An advantage of inline or template methods/functions is that they don't have side-effects as macros have (see [PRE#003]). Another advantage is that inline or template methods/functions are type-safe.
A macro "function" can be defined as a template function, as in:
#define MAX(p1, p2) (((p1) > (p2)) ? (p1) : (p2)) template<class T> T& Max( const T& p1, const T& p2);