associative iterators & views

[SVN r57156]
This commit is contained in:
Christopher Schmidt
2009-10-25 22:59:54 +00:00
parent 35e469e2d5
commit 9b26b4a0f7
69 changed files with 1331 additions and 942 deletions

View File

@ -10,7 +10,12 @@
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/key_of.hpp>
#include <boost/fusion/iterator/deref_data.hpp>
#include <boost/fusion/iterator/value_of_data.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/support/pair.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/static_assert.hpp>
@ -59,6 +64,17 @@ main()
BOOST_STATIC_ASSERT((result_of::has_key<map_type, int>::value));
BOOST_STATIC_ASSERT((result_of::has_key<map_type, double>::value));
BOOST_STATIC_ASSERT((!result_of::has_key<map_type, std::string>::value));
std::cout << deref_data(begin(m)) << std::endl;
std::cout << deref_data(next(begin(m))) << std::endl;
BOOST_TEST(deref_data(begin(m)) == 'X');
BOOST_TEST(deref_data(next(begin(m))) == "Men");
BOOST_STATIC_ASSERT((is_same<result_of::key_of<result_of::begin<map_type>::type>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of::key_of<result_of::next<result_of::begin<map_type>::type>::type>::type, double>::value));
BOOST_STATIC_ASSERT((is_same<result_of::value_of_data<result_of::begin<map_type>::type>::type, char>::value));
BOOST_STATIC_ASSERT((is_same<result_of::value_of_data<result_of::next<result_of::begin<map_type>::type>::type>::type, std::string>::value));
}
{