Subject: Re: [boost] [Range] contains() for unsorted ranges?
From: Neil Groves (neil_at_[hidden])
Date: 2014-04-08 09:24:24
On Mon, Apr 7, 2014 at 1:07 AM, Albert Yiamakis <vkicefire_at_[hidden]> wrote:
> On 06/04/14 20:52, Nathan Ridge wrote:
> > If you're interested in contributing such a function to Boost.Range
> > (including tests and documentation), I'd be happy to review it.
> Sure, I would be happy to do so; first I need to examine how the tests
> and docs are written,
I'm grateful for the offer of assistance. 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. When it is empty it is not present, when it is not empty
there is at least one element. This idiom also automatically works for
find_if and many other algorithms. Therefore explicitly making a
special-case for find seems unnecessary and perhaps a step backwards.
The above is simply my viewpoint. I am currently satisfied with the way
this works. I am keen to avoid numerous special-cases, but I am open to
What this does probably show is that I need to improve my documentation.
This is not clear from the current documentation.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk