/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden 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) ==============================================================================*/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main() { { using namespace boost::fusion; typedef vector2 int_vector; typedef vector2 char_vector; typedef list char_list; typedef vector seqs_type; typedef zip_view view; BOOST_MPL_ASSERT((boost::mpl::equal_to::type, boost::fusion::result_of::size::type>)); BOOST_STATIC_ASSERT((boost::fusion::result_of::size::value == 2)); int_vector iv(1,2); char_vector cv('a', 'b'); char_list cl('y','z'); seqs_type seqs(iv, cv, cl); view v(seqs); BOOST_TEST(at_c<0>(v) == make_vector(1, 'a', 'y')); BOOST_TEST(at_c<1>(v) == make_vector(2, 'b', 'z')); BOOST_TEST(front(v) == make_vector(1, 'a', 'y')); BOOST_TEST(*next(begin(v)) == make_vector(2, 'b', 'z')); BOOST_TEST(advance_c<2>(begin(v)) == end(v)); BOOST_TEST(distance(begin(v), end(v)) == 2); BOOST_STATIC_ASSERT((boost::fusion::result_of::distance::type, boost::fusion::result_of::end::type>::value == 2)); BOOST_MPL_ASSERT((boost::is_same::type, vector3 >)); BOOST_MPL_ASSERT((boost::is_same::type>::type, vector3 >)); } return boost::report_errors(); }