I have an stl iterator resulting from a std::find() and wish to test whether it is the last element. One way to write this is as follows:
mine *match = some
Here's another potential solution:
template bool is_last(Iterator it, const Container& cont) { // REQUIREMENTS: // the iterator must be a valid iterator for `cont` if( it == cont.end() ) return false; // or throw if you prefer return (++it) == cont.end(); }