Possible use cases for std::ranges::empty_view<T>

Viewed 55

After looking at the specification for std::ranges::empty_view and std::ranges::views::empty, I can't think of a use case for a range that is always empty. The only example in the standard is to declare an empty_view and then static_assert that it's empty, which seems pointless to me. My question is what are some possible use cases for an empty_view?

Here's the pertinent cppreference page for reference

https://en.cppreference.com/w/cpp/ranges/empty_view

and the latest working draft of the standard

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4878.pdf

0 Answers
Related