1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_FUSION_COUNT_09162005_0150)
9 #define BOOST_FUSION_COUNT_09162005_0150
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/algorithm/query/count_if.hpp>
13 #include <boost/fusion/algorithm/query/detail/count.hpp>
14 #include <boost/fusion/support/is_sequence.hpp>
15 #include <boost/utility/enable_if.hpp>
17 namespace boost { namespace fusion
21 template <typename Sequence, typename F>
28 template <typename Sequence, typename T>
29 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
32 traits::is_sequence<Sequence>
35 count(Sequence const& seq, T const& x)
37 detail::count_compare<T> f(x);
38 return fusion::count_if(seq, f);