// Copyright Louis Dionne 2013-2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include #include #include #include #include namespace fusion = boost::fusion; namespace mpl = boost::mpl; namespace hana = boost::hana; int main() { { //! [hana] auto tuple = hana::make_tuple(1, 'x', 3.4f); auto result = hana::find_if(tuple, [](auto const& x) { return hana::traits::is_integral(hana::typeid_(x)); }); //! [hana] (void)result; #if 0 //! [hana-explicit] some_type result = hana::find_if(tuple, [](auto const& x) { return hana::traits::is_integral(hana::typeid_(x)); }); //! [hana-explicit] #endif }{ //! [fusion] using Container = fusion::result_of::make_vector::type; Container tuple = fusion::make_vector(1, 'x', 3.4f); using Predicate = mpl::quote1; using Result = fusion::result_of::find_if::type; Result result = fusion::find_if(tuple); //! [fusion] (void)result; } }