23 Ranges library [ranges]

23.7 Range factories [range.factories]

23.7.1 Empty view [range.empty]

23.7.1.1 Overview [range.empty.overview]

empty_­view produces a View of no elements of a particular type.
[Example
:
empty_view<int> e;
static_assert(ranges::empty(e));
static_assert(0 == e.size());
end example
]

23.7.1.2 Class template empty_­view [range.empty.view]

namespace std::ranges {
  template<class T>
    requires is_object_v<T>
  class empty_view : public view_interface<empty_view<T>> {
  public:
    static constexpr T* begin() noexcept { return nullptr; }
    static constexpr T* end() noexcept { return nullptr; }
    static constexpr T* data() noexcept { return nullptr; }
    static constexpr ptrdiff_t size() noexcept { return 0; }
    static constexpr bool empty() noexcept { return true; }

    friend constexpr T* begin(empty_view) noexcept { return nullptr; }
    friend constexpr T* end(empty_view) noexcept { return nullptr; }
  };
}