Boost logo

Boost :

Subject: Re: [boost] [Algorithm] contains(v, 1)
From: Olaf van der Spek (ml_at_[hidden])
Date: 2018-06-04 07:16:28


On Sun, Jun 3, 2018 at 4:45 PM, Jean-Philippe DUFRAIGNE via Boost
<boost_at_[hidden]> wrote:
> On 5/31/18 3:14 AM, Olaf van der Spek via Boost wrote:
>> Hi,
>>
>> vector<int> v;
>> contains(v, 1);
>>
>> This doesn't work as contains expects two ranges (AFAIK).
>> Is there some other function that's usable for this purpose?
>> Should contains support a value for argument 2?
>>
>> Gr,
>>
>
> Hi,
>
> This algorithm exists: boost::any_of_equal
> https://www.boost.org/doc/libs/1_67_0/libs/algorithm/doc/html/the_boost_algorithm_library/CXX11/any_of.html

Thanks!

Too bad ISO C++ didn't include the _equal and range variants.

Gr,

-- 
Olaf

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk