/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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 int main() { using namespace boost::fusion; using boost::mpl::vector_c; using boost::mpl::begin; using boost::mpl::advance; using boost::mpl::int_; std::cout << tuple_open('['); std::cout << tuple_close(']'); std::cout << tuple_delimiter(", "); /// Testing erase { typedef vector vector_type; vector_type t1(1, 'x', 3.3, "Ruby"); vector_iterator pos(t1); std::cout << erase(t1, pos) << std::endl; BOOST_TEST((erase(t1, pos) == make_vector(1, 'x', std::string("Ruby")))); BOOST_TEST((erase(t1, end(t1)) == make_vector(1, 'x', 3.3, std::string("Ruby")))); } { typedef vector_c mpl_vec; typedef boost::mpl::begin::type mpl_vec_begin; typedef boost::mpl::advance >::type mpl_vec_at3; typedef boost::mpl::next::type n1; typedef boost::mpl::next::type n2; typedef boost::mpl::next::type n3; BOOST_STATIC_ASSERT((boost::is_same::value)); std::cout << erase(mpl_vec(), mpl_vec_at3()) << std::endl; BOOST_TEST((erase(mpl_vec(), mpl_vec_at3()) == make_vector(1, 2, 3, 5))); } return boost::report_errors(); }