Files

45 lines
1.2 KiB
C++

#ifndef ACTIV_BOOST_MPL_AUX_COUNT_IMPL_HPP_INCLUDED
#define ACTIV_BOOST_MPL_AUX_COUNT_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <ActivBoost/mpl/count_fwd.hpp>
#include <ActivBoost/mpl/count_if.hpp>
#include <ActivBoost/mpl/same_as.hpp>
#include <ActivBoost/mpl/aux_/config/static_constant.hpp>
#include <ActivBoost/mpl/aux_/config/workaround.hpp>
#include <ActivBoost/mpl/aux_/traits_lambda_spec.hpp>
namespace Boost { namespace mpl {
template< typename Tag > struct count_impl
{
template< typename Sequence, typename T > struct apply
#if ACTIV_BOOST_WORKAROUND(ACTIV_BOOST_BORLANDC,ACTIV_BOOST_TESTED_AT(0x561))
{
typedef typename count_if< Sequence,same_as<T> >::type type;
ACTIV_BOOST_STATIC_CONSTANT(int, value = ACTIV_BOOST_MPL_AUX_VALUE_WKND(type)::value);
#else
: count_if< Sequence,same_as<T> >
{
#endif
};
};
ACTIV_BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,count_impl)
}}
#endif // ACTIV_BOOST_MPL_AUX_COUNT_IMPL_HPP_INCLUDED