|
Boost : |
From: Steve Cornett (boost_at_[hidden])
Date: 2006-02-21 01:39:52
Thanks for the detailed answer. I now see more of the overall purpose of
the macros in stringize.hpp, but your 2nd example does not in fact require
the ## operator to get the behavior you want with Microsoft C++. If you
delete the ## out of macro B, leaving everything else in place, there is no
difference in the behavior; you still get p + q. I tried this with
Microsoft Visual C++ 5 (v11) and Microsoft Visual C++ 2005 (v14):
#define IM p, q
#define A(im) B((im))
#define B(par) C par // no ## here
#define C(x, y) x + y
A(IM) // p + q
So despite your impressive knowledge of Microsoft's preprocessor bugs, I'm
not really convinced the ## is needed in stringize.hpp, at least with
Microsoft C++.
I see the similar ## usage in cat.hpp and iif.hpp, but that code seems
limited to Metrowerks. I'm really only interested in Microsoft C++. In
stringize.hpp was the only place ## was used to produce an invalid token
when I built boost with Microsoft C++ ("bjam -sTOOLS=vc-8_0"). There may be
others places, but those wheels didn't squeak for me.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk