diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1d87705120b..7983c7eb3fd 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2006-08-06 Paolo Carlini + + PR libstdc++/16611 + * include/bits/stl_bvector.h (vector::operator[], + vector::operator[] const): Do not use iterator::operator+, + hand code. + 2006-08-05 Paolo Carlini PR libstdc++/28587 diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 02aa44cd0f0..72982a82ec5 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -575,11 +575,17 @@ template reference operator[](size_type __n) - { return *(begin() + difference_type(__n)); } + { + return *iterator(this->_M_impl._M_start._M_p + + __n / int(_S_word_bit), __n % int(_S_word_bit)); + } const_reference operator[](size_type __n) const - { return *(begin() + difference_type(__n)); } + { + return *const_iterator(this->_M_impl._M_start._M_p + + __n / int(_S_word_bit), __n % int(_S_word_bit)); + } protected: void