
23 Feb
2009
23 Feb
'09
2:02 p.m.
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));