diff --git a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp --- a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp +++ b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp @@ -68,15 +68,18 @@ constexpr ForwardIter begin() const { return ForwardIter(const_cast(buff)); } constexpr ForwardIter end() const { return ForwardIter(const_cast(buff) + 8); } }; +static_assert(std::ranges::view); struct MoveOnlyForwardRange : std::ranges::view_interface { int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7}; MoveOnlyForwardRange(MoveOnlyForwardRange const&) = delete; MoveOnlyForwardRange(MoveOnlyForwardRange &&) = default; + MoveOnlyForwardRange& operator=(MoveOnlyForwardRange &&) = default; MoveOnlyForwardRange() = default; constexpr ForwardIter begin() const { return ForwardIter(const_cast(buff)); } constexpr ForwardIter end() const { return ForwardIter(const_cast(buff) + 8); } }; +static_assert(std::ranges::view); struct EmptyIsTrue : std::ranges::view_interface { int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7}; @@ -84,6 +87,7 @@ constexpr ForwardIter end() const { return ForwardIter(const_cast(buff) + 8); } constexpr bool empty() const { return true; } }; +static_assert(std::ranges::view); struct SizeIsTen : std::ranges::view_interface { int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7}; @@ -91,6 +95,7 @@ constexpr ForwardIter end() const { return ForwardIter(const_cast(buff) + 8); } constexpr size_t size() const { return 10; } }; +static_assert(std::ranges::view); using RAIter = random_access_iterator; @@ -99,6 +104,7 @@ constexpr RAIter begin() const { return RAIter(const_cast(buff)); } constexpr RAIter end() const { return RAIter(const_cast(buff) + 8); } }; +static_assert(std::ranges::view); using ContIter = contiguous_iterator; @@ -107,6 +113,7 @@ constexpr ContIter begin() const { return ContIter(buff); } constexpr ContIter end() const { return ContIter(buff + 8); } }; +static_assert(std::ranges::view); struct DataIsNull : std::ranges::view_interface { int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7}; @@ -114,6 +121,7 @@ constexpr ContIter end() const { return ContIter(buff + 8); } constexpr const int *data() const { return nullptr; } }; +static_assert(std::ranges::view); template struct BoolConvertibleComparison : std::ranges::view_interface> { @@ -136,6 +144,8 @@ constexpr ForwardIter begin() const noexcept { return ForwardIter(const_cast(buff)); } constexpr SentinelType end() const noexcept { return SentinelType(const_cast(buff) + 8); } }; +static_assert(std::ranges::view>); +static_assert(std::ranges::view>); template concept EmptyInvocable = requires (T const& obj) { obj.empty(); };