Opened 15 years ago

Closed 14 years ago

#1099 closed Bugs (fixed)

unable to iterate through a "non-explicitly-declared" mpl::set

Reported by: wheber@… Owned by: Aleksey Gurtovoy
Milestone: To Be Determined Component: mpl
Version: Boost 1.34.0 Severity: Problem
Keywords: Cc:

Description

Iteration through the elements of an explicitly declared mpl::set works as advertised. However, if the set is not explicitly declared, iteration does not compile.

Here is a simple case:

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));

Both compilers I've been able to try report the error (msvc 8.0 and gcc 3.4.4).

Change History (2)

comment:1 by Peter Dimov, 15 years ago

Owner: set to Aleksey Gurtovoy

comment:2 by Aleksey Gurtovoy, 14 years ago

Resolution: fixed
Status: newclosed

This bug has been fixed in 1.35 release.

Note: See TracTickets for help on using tickets.