
23 Feb
2009
23 Feb
'09
5:54 p.m.
Eric Niebler wrote:
And that's my point exactly. I feel that this:
boost::find( rng | filtered(pred) )
is more obscure than this:
boost::find_if( rng, pred );
Not only that, but I presume their return types are different, too. The first would return filtered iterators, the second the original iterators. Isn't that right?
Indeed. Which is why I suggested that boost::find return a [it, end[ range, rather than just the `it' iterator. That way you can do boost::empty(boost::find(rng | filtered(pred))); instead of auto rng2 = rng | filtered(pred); boost::find(rng2) != boost::end(rng2);