[Container] const boost::container::vector is mutable??
Why are the elements of a const boost::vector mutable through its
const_iterator?
#include
El 30/03/2015 a las 19:05, Eric Niebler escribió:
Why are the elements of a const boost::vector mutable through its const_iterator?
It's a bug. The following line in class vec_iterator (vector.hpp): typedef typename boost::intrusive::pointer_traits<Pointer> ptr_traits; should be pointer_traits<pointer> ("pointer" in lowercase). Best, Ion
On 3/30/2015 1:49 PM, Ion Gaztañaga wrote:
El 30/03/2015 a las 19:05, Eric Niebler escribió:
Why are the elements of a const boost::vector mutable through its const_iterator?
It's a bug. The following line in class vec_iterator (vector.hpp):
typedef typename boost::intrusive::pointer_traits<Pointer> ptr_traits;
should be pointer_traits<pointer> ("pointer" in lowercase).
Thanks. That's a bad one. I see static_vector has the same problem since it inherits its iterators from vector. I see someone else noticed this bug 6 days ago: https://svn.boost.org/trac/boost/ticket/11139 -- Eric Niebler Boost.org http://www.boost.org
El 31/03/2015 a las 0:46, Eric Niebler escribió:
On 3/30/2015 1:49 PM, Ion Gaztañaga wrote:
El 30/03/2015 a las 19:05, Eric Niebler escribió:
Why are the elements of a const boost::vector mutable through its const_iterator?
It's a bug. The following line in class vec_iterator (vector.hpp):
typedef typename boost::intrusive::pointer_traits<Pointer> ptr_traits;
should be pointer_traits<pointer> ("pointer" in lowercase).
Thanks. That's a bad one. I see static_vector has the same problem since it inherits its iterators from vector.
Yes. This shows it wasn't properly tested, as I could easily test each container::[const_]iterator public typedef.
I see someone else noticed this bug 6 days ago: https://svn.boost.org/trac/boost/ticket/11139
Thanks Ion
participants (2)
-
Eric Niebler
-
Ion Gaztañaga