/*============================================================================= 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 struct X { operator int() const { return 12345; } }; int main() { using namespace boost::fusion; using boost::mpl::identity; using boost::mpl::vector; /// Testing find { typedef tuple tuple_type; tuple_type t(12345, 'x', 678910, 3.36); std::cout << *boost::fusion::find(t, identity()) << std::endl; BOOST_TEST(*boost::fusion::find(t, identity()) == 'x'); std::cout << *boost::fusion::find(t, identity()) << std::endl; BOOST_TEST(*boost::fusion::find(t, identity()) == 12345); std::cout << *boost::fusion::find(t, identity()) << std::endl; BOOST_TEST(*boost::fusion::find(t, identity()) == 3.36); } { typedef vector mpl_vec; BOOST_TEST((*boost::fusion::find(mpl_vec(), identity()) == 12345)); } return boost::report_errors(); }