Commit da452330 by Paolo Carlini Committed by Paolo Carlini

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
parent bab1de0a
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> 2006-08-05 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28587 PR libstdc++/28587
......
...@@ -575,11 +575,17 @@ template<typename _Alloc> ...@@ -575,11 +575,17 @@ template<typename _Alloc>
reference reference
operator[](size_type __n) 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 const_reference
operator[](size_type __n) const 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: protected:
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment