
10 Apr
2014
10 Apr
'14
8:15 p.m.
On 08/04/14 14:24, Neil Groves wrote:
I would like to point out that you can already do this quite nearly like this: boost::find<boost::return_found_end>(rng, x) since the iterator_range will convert to bool.
Thanks for pointing out this idiom. Meanwhile, I have discovered that Boost.Algorithm's any_of and any_of_equal: http://www.boost.org/doc/libs/1_55_0/libs/algorithm/doc/html/the_boost_algor... work with ranges out of the box, eliminating the need to use find or find_if for this purpose. Note also that there is also a contains() to test whether a range is contained, buried in <boost/algorithm/string/predicate.hpp>. Perhaps these should be presented in the documentation instead? Albert