modern c++11 map implemented

[SVN r82707]
This commit is contained in:
Joel de Guzman
2013-02-04 03:46:42 +00:00
parent d128c6f6aa
commit 996f4152d2
2 changed files with 5 additions and 6 deletions

View File

@ -2,7 +2,7 @@
Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#include <boost/fusion/container/deque/deque.hpp> #include <boost/fusion/container/deque/deque.hpp>

View File

@ -79,12 +79,12 @@ main()
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::begin<map_type>::type>::type, char>::value)); BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::begin<map_type>::type>::type, char>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::begin<map_type>::type>::type>::type, std::string>::value)); BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::begin<map_type>::type>::type>::type, std::string>::value));
//! Test random access interface. // Test random access interface.
pair<int, char> a = at_c<0>(m); pair<int, char> a = at_c<0>(m); (void) a;
pair<double, std::string> b = at_c<1>(m); pair<double, std::string> b = at_c<1>(m);
} }
//! iterators & random access interface. // iterators & random access interface.
{ {
typedef pair<boost::mpl::int_<0>, std::string> pair0; typedef pair<boost::mpl::int_<0>, std::string> pair0;
typedef pair<boost::mpl::int_<1>, std::string> pair1; typedef pair<boost::mpl::int_<1>, std::string> pair1;
@ -107,12 +107,11 @@ main()
BOOST_TEST((deref(fusion::advance_c<4>(it0)) == deref(it4))); BOOST_TEST((deref(fusion::advance_c<4>(it0)) == deref(it4)));
//! Bi-directional // Bi-directional
BOOST_TEST((deref(fusion::prior(it4)) == deref(it3) )); BOOST_TEST((deref(fusion::prior(it4)) == deref(it3) ));
BOOST_TEST((deref(fusion::prior(it3)) == deref(it2) )); BOOST_TEST((deref(fusion::prior(it3)) == deref(it2) ));
BOOST_TEST((deref(fusion::prior(it2)) == deref(it1) )); BOOST_TEST((deref(fusion::prior(it2)) == deref(it1) ));
BOOST_TEST((deref(fusion::prior(it1)) == deref(it0) )); BOOST_TEST((deref(fusion::prior(it1)) == deref(it0) ));
} }
{ {