2006-03-28 Paolo Carlini <pcarlini@suse.de>
* include/ext/vstring.h (operator[]): Allow s[s.size()] in
debug mode, but not pedantic mode.
From-SVN: r112447
+2006-03-28 Paolo Carlini <pcarlini@suse.de>
+
+ * include/ext/vstring.h (operator[]): Allow s[s.size()] in
+ debug mode, but not pedantic mode.
+
2006-03-24 Mark Mitchell <mark@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
reference
operator[](size_type __pos)
{
- _GLIBCXX_DEBUG_ASSERT(__pos < this->size());
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= this->size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < this->size());
this->_M_leak();
return this->_M_data()[__pos];
}