|
Boost : |
From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-04-14 15:47:35
David Abrahams wrote:
> And, BTW, isn't there a meta-lambda version of the above which simplifies
> things a bit?
There is indeed:
template<
typename Sequence
, typename Predicate
>
struct count_if
{
typedef typename fold<
Sequence
, integral_c<unsigned long, 0>
, select_if< apply<Predicate,_2>, next<_1>, _1 >
>::type type;
};
Aleksey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk