What exactly is iterator returned by .end()?
does the standard define what the iterator returned by container.end() points to?
Or the question represented in code:
I see two possibilities:
vector<int>::iterator iter = v.end();
assert( iter == v.end() ); //?
1. iterator returned by container.end() is implemented as a special marker element which is always the same. in this case the assert should not fail
2. iterator returned by container.end() is dynamically derived from the last element of the container. in this case the assert should maybe fail
What does the standard say? Does the answer depend on the container typ?
Thank you in advance!