
22 Feb
2009
22 Feb
'09
7:55 p.m.
Mathias Gaunard wrote:
Marcus Lindblom wrote:
I'm just missing basic "contains/contains_if" function, that searches and retursn a bool on whether an item is in a range. (i.e. find(rng, v) != end(rng) ). I've found those are quite useful. Perhaps this just has another name and I overlooked it?
What about !empty(rng | filtered(_1 == v)).
Sure, and most algorithms can be implemented in terms of fold. It doesn't follow that fold should be the only algorithm. I don't like requiring users to use range adaptors instead of providing algorithms like "find_if" and "contains" that just do what they say. -- Eric Niebler BoostPro Computing http://www.boostpro.com