(sorry, a little late of a reply) Actually, b and c have
indeterminate contents after delete a. Doing ANYTHING with
them is undefined, other than assigning a new value. See
3.7.3.2 in the C++03 standard. Even doing "if ( b != NULL )"
is undefined.
There are a couple of problems with that statement. The first
is that as far as I know, I don't think it has ever really been
decided whether the contents (the actual bits) are
indeterminate. The *value* is indeterminate, and you can't
access the pointer as a pointer, but what about something like:
A *a = new A ;
A *b ;
memcpy( &b, &a, sizeof( A* ) ) ;
delete a ;
if ( memcmp( &a, &b, sizeof( A* ) ) == 0 {
// ...
}
The memcmp is certainly defined behavior; I don't think it has
ever been fully decreed whether the result of that final memcmp
is guaranteed to be 0.
And there are other things but assigning a new value which are
allowed: taking the address or passing by reference, for
example, or accessing the underlying raw bytes.