Boost logo

Boost :

Subject: Re: [boost] Boost.Algorithm design question
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2011-10-06 11:51:03


On Oct 6, 2011, at 8:30 AM, Dave Abrahams wrote:
> on Thu Oct 06 2011, lcaminiti <lorcaminiti-AT-gmail.com> wrote:
>
>> From the standard:
>>
>> // 25.2, non-modifying sequence operations:
>> template <class InputIterator, class Predicate>
>> bool none_of(InputIterator first, InputIterator last, Predicate pred);
>> template<class InputIterator, class T>
>> InputIterator find(InputIterator first, InputIterator last, const T& value);
>>
>> Given that I am used to how the STL works, at first I'd expect
>> Boost.Algorithm to follow the same interface where it makes sense-- why
>> would none_of_equal use an interface different from std::find? Now, if truly
>> the STL interface is incorrect and Boost.Algorithm needs to use
>> iterator_traits::value, wouldn't it make sense to also change the STL
>> interface in the C++ standard?
>
> Yes, it would make sense. No, we won't do it, because it would break
> code.
>
>> I think what I am trying to ask is: Does anyone know why std::find does not
>> use use iterator_traits::value?
>
> IIUC it was an oversight, and IIRC Stepanov's later work (EOP) does
> restrict the type of "value".

I could be misremembering, but didn't iterator_traits come after the first release of the STL?

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


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