First public contribution.
2 #ifndef BOOST_MPL_COUNT_IF_HPP_INCLUDED
3 #define BOOST_MPL_COUNT_IF_HPP_INCLUDED
5 // Copyright Aleksey Gurtovoy 2000-2002
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 // See http://www.boost.org/libs/mpl for documentation.
13 // $Source: /cvsroot/boost/boost/boost/mpl/count_if.hpp,v $
14 // $Date: 2004/09/02 15:40:41 $
17 #include <boost/mpl/fold.hpp>
18 #include <boost/mpl/next.hpp>
19 #include <boost/mpl/integral_c.hpp>
20 #include <boost/mpl/identity.hpp>
21 #include <boost/mpl/eval_if.hpp>
22 #include <boost/mpl/apply.hpp>
23 #include <boost/mpl/aux_/msvc_eti_base.hpp>
24 #include <boost/mpl/aux_/na_spec.hpp>
25 #include <boost/mpl/aux_/lambda_support.hpp>
26 #include <boost/mpl/aux_/config/forwarding.hpp>
28 namespace boost { namespace mpl {
32 template< typename Predicate >
40 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
42 typename apply1<Predicate,T>::type
49 typedef typename eval_if<
50 typename apply1<Predicate,T>::type
62 typename BOOST_MPL_AUX_NA_PARAM(Sequence)
63 , typename BOOST_MPL_AUX_NA_PARAM(Predicate)
66 : aux::msvc_eti_base< typename fold<
68 , integral_c<unsigned long,0>
69 , protect< aux::next_if<Predicate> >
72 BOOST_MPL_AUX_LAMBDA_SUPPORT(2,count_if,(Sequence,Predicate))
75 BOOST_MPL_AUX_NA_SPEC(2, count_if)
79 #endif // BOOST_MPL_COUNT_IF_HPP_INCLUDED