BUG: mpl and iso646.h in vc7

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! Since the iso646.h header is typically force included at the project level, header re-arranging is not a practical solution. Any possibility of getting these headers renamed? Ian

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! Since the iso646.h header is typically force included at the project level, header re-arranging is not a practical solution. Any possibility of getting these headers renamed?
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") -- Eric Niebler Boost Consulting www.boost-consulting.com

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.
participants (3)
-
Eric Niebler
-
Ian Baxter
-
Ken Hagan