Boost logo

Boost :

From: Alexey Nikitin (reductor_at_[hidden])
Date: 2003-10-28 06:01:37


Hello!

I am try to compile next code (i have cutted this from serialization
library)
// t107.cpp
#include <boost/type_traits.hpp>
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/greater.hpp>

namespace boost {
namespace serialization {

enum level_type
{
    not_serializable = 0,
    primitive_type = 1,
    object_serializable = 2,
    object_class_info = 3
};

// default serialization implementation level
template<class T>
struct implementation_level{
    typedef BOOST_DEDUCED_TYPENAME
        mpl::apply_if<
            is_volatile<T>,
            mpl::int_<not_serializable>,
        // else
        // fundamental types are serialized as primitives
        BOOST_DEDUCED_TYPENAME mpl::apply_if<
            mpl::or_<
                is_fundamental<T>,
                is_enum<T>
>,
            mpl::int_<primitive_type>,
        // else
        // other types are serialized along with class info
            mpl::int_<object_class_info>
>
>::type type;
    BOOST_STATIC_CONSTANT(
        enum level_type, value = static_cast<enum level_type>(type::value)
    );
};

}
}

int main()
{
  boost::mpl::greater<
    boost::serialization::implementation_level<size_t>,
    boost::mpl::int_<0>
>::type tmp;
}

with commnd line
cl /GX t107.cpp
and take this errror messages:

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\boost\mpl\greater.hpp(43) : error C2975: 'C_' : invalid
template argument for 'boost::mpl::bool_', compile-time evaluatable constant
expression expected
        C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\boost\mpl\bool.hpp(26) : see declaration of 'C_'
        t107.cpp(51) : see reference to class template instantiation
'boost::mpl::greater<T1,T2>' being compiled
        with
        [
            T1=boost::serialization::implementation_level<size_t>,
            T2=boost::mpl::int_<0>
        ]

if to insert to first line of t107.cpp
#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
compilation pass without erros.

Apparently this define need to VC7.1, but defined only for VC7.0...

PS. I try serialization library draft#12 and boost from CVS repository. May
be exist more later version of serialization library?


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