Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55727 - in trunk: boost/mpl/map/aux_ libs/mpl/test
From: steven_at_[hidden]
Date: 2009-08-23 00:42:26


Author: steven_watanabe
Date: 2009-08-23 00:42:25 EDT (Sun, 23 Aug 2009)
New Revision: 55727
URL: http://svn.boost.org/trac/boost/changeset/55727

Log:
Use order instead of size to find the next order in the non-typeof implementation of mpl::insert for mpl::map. Fixes #2042.
Text files modified:
   trunk/boost/mpl/map/aux_/insert_impl.hpp | 2 +-
   trunk/libs/mpl/test/map.cpp | 23 +++++++++++++++++++++++
   2 files changed, 24 insertions(+), 1 deletions(-)

Modified: trunk/boost/mpl/map/aux_/insert_impl.hpp
==============================================================================
--- trunk/boost/mpl/map/aux_/insert_impl.hpp (original)
+++ trunk/boost/mpl/map/aux_/insert_impl.hpp 2009-08-23 00:42:25 EDT (Sun, 23 Aug 2009)
@@ -39,7 +39,7 @@
>
 #else
         , m_item<
- next< typename Map::size >::type::value
+ Map::order::value
             , typename Pair::first
             , typename Pair::second
             , Map

Modified: trunk/libs/mpl/test/map.cpp
==============================================================================
--- trunk/libs/mpl/test/map.cpp (original)
+++ trunk/libs/mpl/test/map.cpp 2009-08-23 00:42:25 EDT (Sun, 23 Aug 2009)
@@ -194,3 +194,26 @@
     test<mymap>();
     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
+ >
+ ));
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk