Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-02-06 15:21:42


Brock Peabody wrote:
> If I have a vc7.1 source file with nothing but:
>
> #include "stdafx.h"
>
> #include <boost/bind.hpp>
> #include <boost/variant.hpp>
>
> I get the following errors:
>
> c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\boost\mpl\less.hpp(39) : error C2760: syntax error :
> expected ',' not ';'

Nice bug. I think that it's triggered by the "value<" sequence in the code
below:

    enum
    {
        msvc71_wknd_ = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value
                        < BOOST_MPL_AUX_VALUE_WKND(T2)::value )
    };

when the compiler has already seen a template class named "value" (it tries
to keep track of class templates in order to not require typename).

You can work around the problem by replacing the above with

    enum
    {
        msvc71_wknd_ = ( BOOST_MPL_AUX_VALUE_WKND(T2)::value
> BOOST_MPL_AUX_VALUE_WKND(T1)::value )
    };

I've commited the fix to the CVS HEAD as it seems fairly harmless (he said
before breaking all other compilers). ;-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk