1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/mpl/count_if.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,79 @@
1.4 +
1.5 +#ifndef BOOST_MPL_COUNT_IF_HPP_INCLUDED
1.6 +#define BOOST_MPL_COUNT_IF_HPP_INCLUDED
1.7 +
1.8 +// Copyright Aleksey Gurtovoy 2000-2002
1.9 +//
1.10 +// Distributed under the Boost Software License, Version 1.0.
1.11 +// (See accompanying file LICENSE_1_0.txt or copy at
1.12 +// http://www.boost.org/LICENSE_1_0.txt)
1.13 +//
1.14 +// See http://www.boost.org/libs/mpl for documentation.
1.15 +
1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/count_if.hpp,v $
1.17 +// $Date: 2004/09/02 15:40:41 $
1.18 +// $Revision: 1.5 $
1.19 +
1.20 +#include <boost/mpl/fold.hpp>
1.21 +#include <boost/mpl/next.hpp>
1.22 +#include <boost/mpl/integral_c.hpp>
1.23 +#include <boost/mpl/identity.hpp>
1.24 +#include <boost/mpl/eval_if.hpp>
1.25 +#include <boost/mpl/apply.hpp>
1.26 +#include <boost/mpl/aux_/msvc_eti_base.hpp>
1.27 +#include <boost/mpl/aux_/na_spec.hpp>
1.28 +#include <boost/mpl/aux_/lambda_support.hpp>
1.29 +#include <boost/mpl/aux_/config/forwarding.hpp>
1.30 +
1.31 +namespace boost { namespace mpl {
1.32 +
1.33 +namespace aux {
1.34 +
1.35 +template< typename Predicate >
1.36 +struct next_if
1.37 +{
1.38 + template<
1.39 + typename N
1.40 + , typename T
1.41 + >
1.42 + struct apply
1.43 +#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
1.44 + : eval_if<
1.45 + typename apply1<Predicate,T>::type
1.46 + , next<N>
1.47 + , identity<N>
1.48 + >
1.49 + {
1.50 +#else
1.51 + {
1.52 + typedef typename eval_if<
1.53 + typename apply1<Predicate,T>::type
1.54 + , next<N>
1.55 + , identity<N>
1.56 + >::type type;
1.57 +#endif
1.58 + };
1.59 +};
1.60 +
1.61 +} // namespace aux
1.62 +
1.63 +
1.64 +template<
1.65 + typename BOOST_MPL_AUX_NA_PARAM(Sequence)
1.66 + , typename BOOST_MPL_AUX_NA_PARAM(Predicate)
1.67 + >
1.68 +struct count_if
1.69 + : aux::msvc_eti_base< typename fold<
1.70 + Sequence
1.71 + , integral_c<unsigned long,0>
1.72 + , protect< aux::next_if<Predicate> >
1.73 + >::type >
1.74 +{
1.75 + BOOST_MPL_AUX_LAMBDA_SUPPORT(2,count_if,(Sequence,Predicate))
1.76 +};
1.77 +
1.78 +BOOST_MPL_AUX_NA_SPEC(2, count_if)
1.79 +
1.80 +}}
1.81 +
1.82 +#endif // BOOST_MPL_COUNT_IF_HPP_INCLUDED