[Boost-users] Bug using mpl with <ciso646> and MSVC?

Skip to first unread message


Dec 18, 2009, 6:30:02 PM12/18/09
to boost...@lists.boost.org


I am using Spirit with some code that uses the keywords 'and', 'or', etc.
MSVC (at least my version, 9.0) does not implement these keywords, but
support can be added by including <ciso646>, which just has a bunch of
macros, ie. "#define and &&".

The problem I am running into is that when I try to compile something that
uses Spirit and ciso646, I get this compiler error:

boost\mpl\aux_\include_preprocessed.hpp(37) : fatal error C1083: Cannot open
include file: 'boost/mpl/aux_/preprocessed/plain/&.hpp': No such file or

The offending line in include_preprocessed.hpp is:

# include

It looks like the macro 'bitand' is being expanded in here, so it tries to
include '&.hpp'.

Now, I think this problem has already been solved (mostly). See this
archived discussion, where this problem was worked around for 'and' and
'or': http://lists.boost.org/Archives/boost/2004/05/65563.php

I have checked the header files in boost/mpl and only see three more
conflicts between header names and ciso646 macros: 'bitand', 'bitor', and
'not'. If someone with more expertise than myself could implement a similar
workaround for these headers, I would be very grateful.


View this message in context: http://old.nabble.com/Bug-using-mpl-with-%3Cciso646%3E-and-MSVC--tp26851153p26851153.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users mailing list


Dec 21, 2009, 1:44:17 PM12/21/09
to boost...@lists.boost.org

I got this working with a pretty direct copy/paste/find/replace using the
current and.hpp as a template. See these links for the contents of my
bitand.hpp and bitor.hpp:


It turns out that even though there is a not.hpp file, and ciso646 defines
the macro 'not', it doesn't cause problems, at least for me. This might
still cause issues down the road, maybe not. I'm not really sure what's
going on in not.hpp.

I don't know how this kind of thing works, but this seems like a legitimate
(if obscure) problem in need of an official workaround. How do I go about
getting this little fix uploaded to the boost repositories? Should I email
the mpl maintainers directly, or do they read this list fairly often?

Erik Bryan
View this message in context: http://old.nabble.com/Bug-using-mpl-with-%3Cciso646%3E-and-MSVC--tp26851153p26877787.html

Reply all
Reply to author
0 new messages