1
0
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:
Steven Watanabe
2009-08-23 04:42:25 +00:00
parent c1de64359f
commit d38f271fae
2 changed files with 24 additions and 1 deletions

View File

@@ -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

View File

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