From d38f271fae14063cfa6a8b7e69a0e870a01a61ce Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sun, 23 Aug 2009 04:42:25 +0000 Subject: [PATCH] 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] --- include/boost/mpl/map/aux_/insert_impl.hpp | 2 +- test/map.cpp | 23 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/boost/mpl/map/aux_/insert_impl.hpp b/include/boost/mpl/map/aux_/insert_impl.hpp index 42232a2..fb61ed9 100644 --- a/include/boost/mpl/map/aux_/insert_impl.hpp +++ b/include/boost/mpl/map/aux_/insert_impl.hpp @@ -39,7 +39,7 @@ struct map_insert_impl > #else , m_item< - next< typename Map::size >::type::value + Map::order::value , typename Pair::first , typename Pair::second , Map diff --git a/test/map.cpp b/test/map.cpp index aaa44b8..17ad99d 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -194,3 +194,26 @@ MPL_TEST_CASE() test(); test(); } + +MPL_TEST_CASE() +{ + typedef mpl::erase_key< + mpl::map< + mpl::pair + , mpl::pair + > + , char + >::type int_to_float_map; + + typedef mpl::insert< + int_to_float_map + , mpl::pair + >::type with_char_too; + + BOOST_MPL_ASSERT(( + boost::is_same< + mpl::at::type + , long + > + )); +}