References, pointers, and iterators referring to the elements of a basic_string
sequence may be invalidated
by the following uses of that basic_string
object:
- As an argument to non-member functions
swap()
,operator>>()
, andgetline()
. - As an argument to
basic_string::swap()
. - Calling
data()
andc_str()
member functions. Calling non-const member functions, except
operator[]()
,at()
,begin()
,rbegin()
,end()
, andrend()
.Subsequent to any of the above uses except the forms of
insert()
anderase()
which return iterators, the first call to non-const member functionsoperator[]()
,at()
,begin()
,rbegin()
,end()
, orrend()
.
References
- ISO/IEC 14882-2003 21.3 Class template basic_string