Boost logo

Boost :

Subject: Re: [boost] ptr_vector requiring non-const iterator for insert
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2014-06-26 05:03:02


On 31-05-2014 12:05, Florian Burkart wrote:
> Hi,
>
> I noticed that ptr_vector requires a non-const iterator for insert.
>
> This is inherited from ptr_sequence_adapter, which defines
>
> iterator insert( iterator position, T* x );
>
> Under C++11, this differs from std::vector, which, since C++11, is happy to
> take const_iterators.
>
> iterator insert( const_iterator pos, const T& value );
>
> I read somewhere that C++11 was attempting to clear up some confusion in
> the standard between iterator constness and container constness.
>
> Just wondering whether this should be adopted (e.g. changed) in ptr
> containers.

It should.

I guess if you file a bug fix, it could happen.

-Thorsten


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