Boost logo

Boost :

From: joel de guzman (djowel_at_[hidden])
Date: 2002-04-14 17:35:26


----- Original Message -----
From: "Aleksey Gurtovoy" :
>
> Is this one better?
>
> 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;
> };

I like this one a lot, Aleksey! It looks a lot like the fold that I
am accustomed to. In fact I was almost about to post something
like this but hesitated. Can we do it this way? If so, why did we
bother with the long one? What's the advantage of the first over
this?

Cheers (and thanks!),
--Joel

PS> I still hope you guys will change your mind regarding the
mutating-sounding names. Nevertheless, the one above is
refreshing.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk