Boost logo

Boost Users :

From: Brian Simpson (wheber_at_[hidden])
Date: 2007-06-25 18:36:20


I'm having problems compiling non-explicitly-declared mpl::set types.
Here's an example:

<block1>
typedef set<char> set1_t;
BOOST_MPL_ASSERT_RELATION(size<set1_t>::value, ==, 1);
//test iterating through the mpl.set:
typedef begin<set1_t>::type set1_itr0_t;
BOOST_MPL_ASSERT((is_same<deref<set1_itr0_t>::type, char>::type));
typedef next<set1_itr0_t>::type set1_itr1_t;
BOOST_MPL_ASSERT((is_same<set1_itr1_t, end<set1_t>::type>::type));
</block1>

In block1, I declare a set with one type, char, and then iterate over it.
This code compiles, as expected.

<block2>
typedef set<> empty_set;
BOOST_MPL_ASSERT_RELATION(size<empty_set>::value, ==, 0);

typedef insert<empty_set, char>::type set2_t;
BOOST_MPL_ASSERT_RELATION(size<set2_t>::value, ==, 1);
//test iterating through the mpl.set:
typedef begin<set2_t>::type set2_itr0_t;
BOOST_MPL_ASSERT((is_same<deref<set2_itr0_t>::type, char>::type));
typedef next<set2_itr0_t>::type set2_itr1_t;//compile error at this line
BOOST_MPL_ASSERT((is_same<set2_itr1_t, end<set2_t>::type>::type));
</block2>

In block2, I declare a set with no types, then insert a char type, then
iterate over the resulting sequence. At the line where I get the second
iterator, I get a compile error:
<error_text>
boost\mpl\set\aux_\iterator.hpp(52) : error C3083: 'next_': the symbol to
the left of a '::' must be a type
        boost\mpl\eval_if.hpp(41) : see reference to class template
instantiation 'boost::mpl::next<T>' being compiled
        with
        [
            
T=boost::mpl::s_iter<set2_t,boost::mpl::set<boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>>
        ]
        boost\mpl\set\aux_\iterator.hpp(56) : see reference to class
template instantiation 'boost::mpl::eval_if<C,F1,F2>' being compiled
        with
        [
            
C=boost::mpl::has_key<set2_t,boost::mpl::set<boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>::type>,
            
F1=boost::mpl::identity<boost::mpl::s_iter<set2_t,boost::mpl::set<boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>>>,
            
F2=boost::mpl::next<boost::mpl::s_iter<set2_t,boost::mpl::set<boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>>>
        ]
        source.cpp(120) : see reference to class template instantiation
'boost::mpl::next<T>' being compiled
        with
        [
            T=set2_itr0_t
        ]
</error_text>

MSVS 8.0 is the compiler(_MSC_VER == 1400).

Am I missing an obvious error in my code?

Thanks!

_________________________________________________________________
Need a break? Find your escape route with Live Search Maps.
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Park&cp=33.832922~-117.915659&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=1118863&encType=1&FORM=MGAC01


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net