forked from boostorg/mpl
Use order instead of size to find the next order in the non-typeof implementation of mpl::insert for mpl::map. Fixes #2042.
[SVN r55727]
This commit is contained in:
@@ -39,7 +39,7 @@ struct map_insert_impl
|
|||||||
>
|
>
|
||||||
#else
|
#else
|
||||||
, m_item<
|
, m_item<
|
||||||
next< typename Map::size >::type::value
|
Map::order::value
|
||||||
, typename Pair::first
|
, typename Pair::first
|
||||||
, typename Pair::second
|
, typename Pair::second
|
||||||
, Map
|
, Map
|
||||||
|
23
test/map.cpp
23
test/map.cpp
@@ -194,3 +194,26 @@ MPL_TEST_CASE()
|
|||||||
test<mymap>();
|
test<mymap>();
|
||||||
test<mymap::type>();
|
test<mymap::type>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MPL_TEST_CASE()
|
||||||
|
{
|
||||||
|
typedef mpl::erase_key<
|
||||||
|
mpl::map<
|
||||||
|
mpl::pair<char, double>
|
||||||
|
, mpl::pair<int, float>
|
||||||
|
>
|
||||||
|
, char
|
||||||
|
>::type int_to_float_map;
|
||||||
|
|
||||||
|
typedef mpl::insert<
|
||||||
|
int_to_float_map
|
||||||
|
, mpl::pair<char, long>
|
||||||
|
>::type with_char_too;
|
||||||
|
|
||||||
|
BOOST_MPL_ASSERT((
|
||||||
|
boost::is_same<
|
||||||
|
mpl::at<with_char_too, char>::type
|
||||||
|
, long
|
||||||
|
>
|
||||||
|
));
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user