From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2004-05-19 09:23:15
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
'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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk