
30 Mar
2015
30 Mar
'15
5:05 p.m.
Why are the elements of a const boost::vector mutable through its const_iterator? #include <boost/container/vector.hpp> int main() { using C = boost::container::vector<int>; C c{1,2,3,4}; C const & r = c; r[0] = 42; // Error, good. *r.begin() = 42; // Compiles! huh?? } -- Eric Niebler Boost.org http://www.boost.org