File indexing completed on 2025-01-18 09:31:09
0001
0002
0003
0004
0005
0006
0007
0008 #if !defined(FUSION_FIND_05052005_1107)
0009 #define FUSION_FIND_05052005_1107
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.hpp>
0015 #include <boost/fusion/iterator/key_of.hpp>
0016 #include <boost/fusion/iterator/value_of.hpp>
0017 #include <boost/fusion/support/category_of.hpp>
0018 #include <boost/fusion/support/is_segmented.hpp>
0019 #include <boost/mpl/if.hpp>
0020 #include <boost/mpl/placeholders.hpp>
0021 #include <boost/type_traits/is_same.hpp>
0022 #include <boost/type_traits/is_const.hpp>
0023 #include <boost/utility/enable_if.hpp>
0024
0025 namespace boost { namespace fusion
0026 {
0027 namespace result_of
0028 {
0029 template <typename Sequence, typename T>
0030 struct find
0031 : mpl::if_<
0032 traits::is_segmented<Sequence>
0033 , detail::result_of_segmented_find<Sequence, T>
0034 , detail::result_of_find_if<
0035 Sequence,
0036 is_same<
0037 typename mpl::if_<
0038 traits::is_associative<Sequence>
0039 , key_of<mpl::_1>
0040 , value_of<mpl::_1>
0041 >::type
0042 , T
0043 >
0044 >
0045 >::type
0046 {};
0047 }
0048
0049 template <typename T, typename Sequence>
0050 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0051 inline typename
0052 lazy_disable_if<
0053 is_const<Sequence>
0054 , result_of::find<Sequence, T>
0055 >::type const
0056 find(Sequence& seq)
0057 {
0058 typedef typename result_of::find<Sequence, T>::filter filter;
0059 return filter::call(seq);
0060 }
0061
0062 template <typename T, typename Sequence>
0063 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0064 inline typename result_of::find<Sequence const, T>::type const
0065 find(Sequence const& seq)
0066 {
0067 typedef typename result_of::find<Sequence const, T>::filter filter;
0068 return filter::call(seq);
0069 }
0070 }}
0071
0072 #endif