Is it defined anywhere what happens if I run code such as:
Using C, the equivalent operation (dereference the pointer to one character beyond the last non-NULL one) always produces NULL; it would be nice to know something similar about the STL string.
That is, will something predictable happen when I try to dereference the end() iterator of a string (or, I suppose, of another sequence or hash)?code:<HR>Code:void end_iterator(void) { std::string s = "iterator test"; std::string::const_iterator si;<P> char c = *si.end();<P> std::cout << c << std::endl; }
Using C, the equivalent operation (dereference the pointer to one character beyond the last non-NULL one) always produces NULL; it would be nice to know something similar about the STL string.