/*============================================================================= Copyright (c) 2003 Joel de Guzman Use, modification and distribution is subject to 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 struct X { operator char const*() const { return ""; } }; struct Y { operator char const*() const { return ""; } }; int main() { using namespace boost::fusion; using boost::mpl::vector; using boost::mpl::_; using boost::mpl::not_; using boost::is_class; using boost::is_same; std::cout << tuple_open('['); std::cout << tuple_close(']'); std::cout << tuple_delimiter(", "); /// Testing remove_if X x; Y y; typedef tuple tuple_type; tuple_type t(y, '@', 987654, x, true, 6.6); { std::cout << remove_if(t, not_ >()) << std::endl; BOOST_TEST((remove_if(t, not_ >()) == make_tuple(y, x))); } { std::cout << remove_if(t, is_class<_>()) << std::endl; BOOST_TEST((remove_if(t, is_class<_>()) == make_tuple('@', 987654, true, 6.6))); } { typedef vector mpl_vec; BOOST_TEST((remove_if(mpl_vec(), not_ >()) == tuple())); BOOST_TEST((remove_if(mpl_vec(), is_class<_>()) == tuple())); } return boost::report_errors(); }