* include/bits/basic_string.h (operator[]): Allow s[s.size()] in
debug mode, but not pedantic mode.
From-SVN: r99967
+2005-05-19 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * include/bits/basic_string.h (operator[]): Allow s[s.size()] in
+ debug mode, but not pedantic mode.
+
2005-05-19 Jan Beulich <jbeulich@novell.com>
* libsupc++/unwind-cxx.h: Include cstdlib.
reference
operator[](size_type __pos)
{
- _GLIBCXX_DEBUG_ASSERT(__pos < size());
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < size());
_M_leak();
return _M_data()[__pos];
}