Why do you believe that there is a speed advantage to using the
preprocessor rather than templates for generic code?
I don't believe such a thing, you misread. If you still have trouble
understanding what I wrote after second reading please ask for
clarifications.
With VC++, l've observed problems where it won't really inline
functions which are declared inline. Did you switch from a
templated inline function or a templated class with inline
functions to macros, and see a speedup?
That is VC++ specific behaviour and not topical at clc++ but I can tell
you that there are compiler specific #pragma's to force inlining to
have more depth in case of recursive meta programs (for example) and
you can try __forceinline keyword, which is also compiler specific.
Like I said, optimizations when specific assembly output or similiar
equivalent are required are toolchain and platform specific. Btw. you
can configure most versions of Visual C++ between 6.0 and 2005 to have
different handling of inline keyword to suit your preferences and
tastes better. If you have problems with your compiler and improving
performance of your software feel free to ask specific questions,
hopefully with concrete code and also don't forget to mention which
compiler and target you are using.
To answer your question: No (and no). Explanation: I don't use
preprocessor macros for function inline expansion. Why: because I write
code in a way that it is not so dependent on particular inlining
invoked or not at compilation time. Only the code that is absolutely
performance critical, I do check compiler output and adjust the code to
achieve the desired result. Again, this is compiler and platform
specific and such code and activity is not what I'd discuess in this
particular group.