Re: [boost] Re: BUG: mpl and iso646.h in vc7

Ken Hagan writes:
Ian Baxter wrote:
Boosters,
Microsoft's macro hacks in the iso646.h header unfortunately kills the current MPL implementation. The headers or.hpp, and.hpp are substituted as ||.hpp, &&.hpp!
Eric Niebler wrote:
I don't think changing the header names is the right solution. Since you're on VC7, you can use the push_macro and pop_macro pragmas to work around the issue.
// file: or_.hpp #pragma once #pragma push_macro("or") #include <boost/mpl/or.hpp> #pragma pop_macro("or")
Nice workaround, but it won't help you much if you are using a library that uses MPL. Renaming the header will upset everyone's sense of aesthetics, but resolves the problem once and for all.
Incidentally, I assume VC7 is looking at
#include <boost/mpl/or.hpp>
and macro expanding the "or". The standard text for preprocessing phase 4 does indeed begin "Preprocessing directives are executed and macro invocations are expanded.", but the text for phase 3 begins "The source file is decomposed into preprocessing tokens..." and I would have thought that "boost/mpl/or.hpp" (without the quotes) was a single h-char-sequence in this context so there is no invocation of the "or" macro here. Clearly at least one of "me" and "VC" must be wrong here.
You are both right :). In #include <boost/mpl/or.hpp> 'boost/mpl/or.hpp' *is* a single h-char-sequence and MSVC does *not* perform macro substitution here. The problem Ian reported was caused by the code that roughly looked like this: # define HEADER or.hpp # include BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/HEADER) Fixed in the CVS now. No changes are required on user part. Thanks to everybody, -- Aleksey Gurtovoy MetaCommunications Engineering
participants (1)
-
Aleksey Gurtovoy