When iota_view
receives different argument types, .end()
returns a sentinel instead of an iterator.
A sentinel is a type that's ==
-comparable with an iterator, and optionally subtractible from it (the latter makes it a sized sentinel).
If it happens to not be subtractible, ranges::partition_point
can't know the range size in advance, and has to increment the iterator step by step (almost as if it wasn't random-access).
For some reason, for iota_view<A,B>
this sentinel is specified to overload -
only if std::sized_sentinel_for<B, A> == true
, which is false, because neither is an iterator in this case (int
and long long
).