In message
<c76ba343-355d-46ed-b028-3cd137425...@s13g2000prd.googlegroups.com>, Old
Its value has become singular, certainly, but that's because
the set of singular values has changed, not because the
iterator has.
If it doesn't point anywhere, it points nowhere. "nowhere"
looks pretty invalid to me.
It doesn't point, period.
Consider:
#include <vector>
#include <cstring>
#include <iostream>
int
main()
{
static int const init[] = { 1, 2, 3, 4, 5 } ;
std::vector< int > v( init, init + 5 ) ;
std::vector< int >::iterator
iter = v.begin() + 3 ;
unsigned char before[ sizeof( iter ) ] ;
std::memcpy( before, &iter, sizeof( iter ) ) ;
v.erase( iter ) ;
if ( std::memcmp( before, &iter, sizeof( iter ) ) == 0 ) {
std::cout << "unchanged" << std::endl ;
} else {
std::cout << "changed" << std::endl ;
}
}
On my implementation, this outputs "changed". And any attempt
to access iter as an std::vector< int >::iterator (e.g. to copy
it, compare it, etc.) generates a core dump.
I don't quite know what you mean by "its representation". If
it's just the underlying bits in memory, then it's changed. If
it's anything else, then you can't tell, because there's nothing
you can do other than look at the bytes that has defined
behavior (and the implementation I normally use core dumps in
all of the cases of undefined behavior).