Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:31:09

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2011 Eric Niebler
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(FUSION_FIND_IF_05052005_1108)
0009 #define FUSION_FIND_IF_05052005_1108
0010 
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/algorithm/query/find_if_fwd.hpp>
0013 #include <boost/fusion/algorithm/query/detail/find_if.hpp>
0014 #include <boost/fusion/algorithm/query/detail/segmented_find_if.hpp>
0015 #include <boost/fusion/iterator/value_of.hpp>
0016 #include <boost/fusion/support/is_segmented.hpp>
0017 #include <boost/utility/enable_if.hpp>
0018 #include <boost/type_traits/is_const.hpp>
0019 #include <boost/mpl/bind.hpp>
0020 #include <boost/mpl/lambda.hpp>
0021 #include <boost/mpl/placeholders.hpp>
0022 #include <boost/mpl/quote.hpp>
0023 
0024 namespace boost { namespace fusion
0025 {
0026     namespace result_of
0027     {
0028         template <typename Sequence, typename Pred>
0029         struct find_if
0030           : mpl::if_<
0031                 traits::is_segmented<Sequence>
0032               , detail::result_of_segmented_find_if<Sequence, Pred>
0033               , detail::result_of_find_if<
0034                     Sequence,
0035                     mpl::bind1<
0036                         typename mpl::lambda<Pred>::type
0037                       , mpl::bind1<mpl::quote1<value_of>, mpl::_1>
0038                     >
0039                 >
0040             >::type
0041         {};
0042     }
0043 
0044     template <typename Pred, typename Sequence>
0045     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0046     inline typename
0047         lazy_disable_if<
0048             is_const<Sequence>
0049           , result_of::find_if<Sequence, Pred>
0050         >::type
0051     find_if(Sequence& seq)
0052     {
0053         typedef typename result_of::find_if<Sequence, Pred>::filter filter;
0054         return filter::call(seq);
0055     }
0056 
0057     template <typename Pred, typename Sequence>
0058     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0059     inline typename result_of::find_if<Sequence const, Pred>::type const
0060     find_if(Sequence const& seq)
0061     {
0062         typedef typename result_of::find_if<Sequence const, Pred>::filter filter;
0063         return filter::call(seq);
0064     }
0065 }}
0066 
0067 #endif