Commit df108331 by Paolo Carlini Committed by Paolo Carlini

vstring.h (operator[]): Allow s[s.size()] in debug mode, but not pedantic mode.

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
parent 37e47ee9
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>
......
......@@ -449,7 +449,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
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];
}
......
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