Class unreachable is a sentinel type that can be used with any Iterator to denote an infinite range. Comparing an iterator for equality with an object of type unreachable always returns false.
[ Example:
char* p;
// set p to point to a character buffer containing newlines
char* nl = find(p, unreachable(), '\n');
Provided a newline character really exists in the buffer, the use of unreachable above potentially makes the call to find more efficient since the loop test against the sentinel does not require a conditional branch. — end example ]
namespace std { namespace experimental { namespace ranges { inline namespace v1 { class unreachable { }; template <Iterator I> constexpr bool operator==(const I&, unreachable) noexcept; template <Iterator I> constexpr bool operator==(unreachable, const I&) noexcept; template <Iterator I> constexpr bool operator!=(const I&, unreachable) noexcept; template <Iterator I> constexpr bool operator!=(unreachable, const I&) noexcept; }}}}
template <Iterator I>
constexpr bool operator==(const I&, unreachable) noexcept;
template <Iterator I>
constexpr bool operator==(unreachable, const I&) noexcept;
Returns: false.
template <Iterator I>
constexpr bool operator!=(const I& x, unreachable y) noexcept;
template <Iterator I>
constexpr bool operator!=(unreachable x, const I& y) noexcept;
Returns: true.