Boost logo

Boost :

Subject: Re: [boost] Boost.RangeEx: contains?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-02-23 09:02:59


Robert Jones wrote:

> I'm sorry if I'm being a bit slow here, but I've lost the thread somewhat!
>
> "...most algorithms can be implemented in terms of fold.",
> "...what is the fold algorithm?".
> "...std::accumulate."
>
> So most algorithms can be implemented in terms of std::accumulate?

std::accumulate is the name of the algorithm that is typically known as
fold in functional programming languages.

http://en.wikipedia.org/wiki/Fold_(higher-order_function)

> If so I think I can see your point, but surely empty() in terms of std::
> accumulate
> would be a bit obtuse?

It wouldn't be very complicated, just not efficient.
accumulate(rng, true, phoenix::val(false));


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