/*============================================================================= Copyright (c) 2003 Joel de Guzman Copyright (c) 2004 Peder Holt 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) ==============================================================================*/ #if !defined(FUSION_ALGORITHM_FIND_IF_HPP) #define FUSION_ALGORITHM_FIND_IF_HPP #include #include #include namespace boost { namespace fusion { namespace meta { template struct find_if { typedef typename detail::static_find_if< typename meta::begin::type , typename meta::end::type , Pred >::type type; }; } namespace function { struct find_if { template struct apply : meta::find_if {}; template inline typename apply::type operator()(Sequence const& seq, Pred) const { typedef detail::static_find_if< BOOST_DEDUCED_TYPENAME meta::begin::type , BOOST_DEDUCED_TYPENAME meta::end::type , Pred > filter; return filter::call(fusion::begin(seq)); } template inline typename apply::type operator()(Sequence& seq, Pred) const { typedef detail::static_find_if< BOOST_DEDUCED_TYPENAME meta::begin::type , BOOST_DEDUCED_TYPENAME meta::end::type , Pred > filter; return filter::call(fusion::begin(seq)); } }; } function::find_if const find_if = function::find_if(); }} #endif