diff options
author | Paolo Carlini <pcarlini@suse.de> | 2006-08-06 14:45:04 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2006-08-06 14:45:04 +0000 |
commit | da452330ca74511d2d295f9cfa751941cfc67503 (patch) | |
tree | b248a2452612d54b765dae28a554740cd7f1f7dc | |
parent | bab1de0adbbf48be61d056c7fc62a719798b4781 (diff) | |
download | gcc-da452330ca74511d2d295f9cfa751941cfc67503.zip gcc-da452330ca74511d2d295f9cfa751941cfc67503.tar.gz gcc-da452330ca74511d2d295f9cfa751941cfc67503.tar.bz2 |
re PR libstdc++/16611 (Terrible code generated for vector<bool>)
2006-08-06 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/16611
* include/bits/stl_bvector.h (vector<bool>::operator[],
vector<bool>::operator[] const): Do not use iterator::operator+,
hand code.
From-SVN: r115972
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_bvector.h | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1d87705..7983c7e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2006-08-06 Paolo Carlini <pcarlini@suse.de> + + PR libstdc++/16611 + * include/bits/stl_bvector.h (vector<bool>::operator[], + vector<bool>::operator[] const): Do not use iterator::operator+, + hand code. + 2006-08-05 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28587 diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 02aa44c..72982a8 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -575,11 +575,17 @@ template<typename _Alloc> 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 |