How about the C++ standard? It's not easy to read, but definitively the reference.
Go to
open-std.org: Working Draft, Standard for Programming
Language C++[
^] or any newer version. The preprocessor has most likely not changed.
There are a few tricky parts in the preprocessor:
- the accepted PP number tokens are not necessarily legal C/C++ literals
- re-evaluation of function macro arguments
- re-evaluation of # and ## PP tokens
- PP expression evaluation is not necessarily the same as for the final program
- handling some special cases (pragmas, line splicing/line numbering, etc.)
Cheers
Andi