Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-21 09:23:44

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2007 Dan Marsden
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(BOOST_FUSION_COUNT_09162005_0150)
0009 #define BOOST_FUSION_COUNT_09162005_0150
0010 
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/algorithm/query/count_if.hpp>
0013 #include <boost/fusion/algorithm/query/detail/count.hpp>
0014 #include <boost/fusion/support/is_sequence.hpp>
0015 #include <boost/utility/enable_if.hpp>
0016 
0017 namespace boost { namespace fusion
0018 {
0019     namespace result_of
0020     {
0021         template <typename Sequence, typename F>
0022         struct count
0023         {
0024             typedef int type;
0025         };
0026     }
0027 
0028     template <typename Sequence, typename T>
0029     BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0030     inline typename
0031         enable_if<
0032             traits::is_sequence<Sequence>
0033           , int
0034         >::type
0035     count(Sequence const& seq, T const& x)
0036     {
0037         detail::count_compare<T> f(x);
0038         return fusion::count_if(seq, f);
0039     }
0040 }}
0041 
0042 #endif
0043