When references, pointers, and iterators to a string become invalid
Posted on 2004-04-14
From the standard I gather that references, pointers, and iterators to a string become invalid after:
calling any non-const member functions (with the exception of , at, begin, end, rbegin, rend)
calling data or c_str
the first call to non-const functions , at, begin, end, rbegin, rend
However, what isn't immediately obvious is that the standard defines compare() as:
traits::compare(data(), str.data(), rlen);
And most string implementations use compare() in the comparison operators.
So can one add to that list all of the compare() overloads and comparison operators?
Is that a justifiable statement? And might there be any more exceptions?