Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-27 12:37:32

Daniel Krügler <dsp_at_[hidden]> writes:

> A contrived example for the first issue was given in my original
> posting. I repeat it here again:
> ---------------------------------------------------------------
> #include <boost/mpl/vector.hpp>
> #include <boost/mpl/size.hpp>
> void foo(const long&)
> {
> }
> int main()
> {
> typedef boost::mpl::vector<char, double> MyTypeContainer;
> typedef boost::mpl::size<MyTypeContainer> MPSizeType;
> foo(MPSizeType::value);
> }
> ---------------------------------------------------------------
> Switch to /Za, if you use the VC7.1, the mentioned mingw compiler will
> choke anyway.

I don't understand the assertion. What does mingw have to do with vc7.1

> The second problem would result **iff** boost provides the missing
> definitions of boost::mpl::size<>::value and similar. In this case
> the VC7.1 compiler would choke similarily (but fortuneatly not the
> mingw compiler any longer), if instead of the /Za flag the
> complimentary /Ze flag is set :-((

Hmm. I'm very surprised. It appears that when /Za is supplied,
*nothing* you can do will cause an integral static const member to be
instantiated, and when /Za is not supplied, an out-of-line definition
makes no difference because it's not needed. Furthermore, according
to the MS docs, the compiler supplies no preprocessor symbol we could
use to detect /Za and switch to using enums. I'm not sure there's a
workaround for this one.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at