Hello gents,
I would like to suggest the following helper type:
"null_iter"
It is of type iterator but convertible to the boolean value "false", much like the type: "nullptr"
This value "null_iter" is returned by all container iterators types (vector::iterator, list::iterator, set::iterator...etc) to denote the end of the container when you apply the increment or decrement operators.
For exple:
--------- code snippet -------
std::vector<int> v{1,2,3,4};
auto iter = v.begin();
while(++iter)
{
    //
}
------- end of snippet------

 When "iter" hits "v.end()", it will return "null_iter" which will be converted to "false" then the loop stops.

What do you think?

Nadir


Sent from my Galaxy