The tag type
dangling is used together with the template aliases
borrowed_iterator_t and
borrowed_subrange_t. When an algorithm
that typically returns an iterator into, or a subrange of, a range argument
is called with an rvalue range argument
that does not model
borrowed_range (
[range.range]),
the return value possibly refers to a range whose lifetime has ended
. In such cases,
the tag type
dangling is returned instead of an iterator or subrange
. namespace std::ranges {
struct dangling {
constexpr dangling() noexcept = default;
template<class... Args>
constexpr dangling(Args&&...) noexcept { }
};
}