It is sometimes necessary to find the index at which an
iterator is situated for a given data structure
instance, such as an ordered vector. This is
accomplished using the "Get_Loc(Iter)" function.
However, if previous operations on the iterator, such
as invoking Get_Incr(), have left the iterator in a
Past_End state, calling Get_Loc raises an
Object_Updated exception. This is fine, however, there
is no means to query the iterator beforehand to
determine whether the iterator's current location is
Past_End or Not_Past_End. The only way to determine
this then is to invoke Get_Loc wrapped in an exception
handler that handles Object_Updated, and assume that if
the exception is raised, the iterator is actually
Past_End.
A function for querying for this state would be a
useful addition. For example:
function At_End(Iter : in Iterator) return End_Marker;
The only class I could find that did this was Asgc.Ordered.Vector, which would invalidate the iterator at the end. None of the other classes did this, so I removed the invalidate.