>As described in Effective C++ by Scott Meyers (an awesome book BTW),
>macros are evil. It's always better to use the compiler instead of the
>preprocessor if given equal opportunity to use both. Inline and
>templatized functions make the macro use in the case of Abs less than
>optimal. If for nothing else, it makes debugging more difficult in the
>case of the macro.
true. however the caveat "if given equal opportunity to use both" is where
it gets interesting. "equal opportunity" can mean more than just "your
compiler supports both" (unless you don't care about efficiency). for the
Abs case, though, the problem is that the PalmOS headers must target C. not
all C compilers allow inline functions (that's a C++ extension which only
some C compilers allow).
fwiw, i wrote a "UInt _Abs(Int x)" function (not inline) which in my
specific case results in less code generated, faster execution, slightly
more stack usage, and correct result. <g>