This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] libstdc++/16611
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 06 Aug 2006 16:50:01 +0200
- Subject: [v3] libstdc++/16611
Hi,
tested x86-linux, committed to mainline.
Paolo.
////////////////
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.
Index: include/bits/stl_bvector.h
===================================================================
--- include/bits/stl_bvector.h (revision 115971)
+++ include/bits/stl_bvector.h (working copy)
@@ -575,11 +575,17 @@
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