[libcxx-commits] [libcxx] [libc++][NFC] Add additional tests for begin/end of std::ranges::take_view (PR #79085)
Konstantin Varlamov via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 1 16:05:19 PDT 2024
================
@@ -69,13 +81,51 @@ constexpr bool test() {
ASSERT_SAME_TYPE(decltype(tv.begin()), std::counted_iterator<int*>);
}
- // simple-view<V> && sized_range<V> && !size_range<!V>
+ // simple-view<V> && sized_range<V> && !sized_range<const V>
{
+ static_assert(simple_view<NonCommonSimpleView>);
+ static_assert(std::ranges::sized_range<NonCommonSimpleView>);
+ static_assert(!std::ranges::sized_range<const NonCommonSimpleView>);
+
std::ranges::take_view<NonCommonSimpleView> tv{};
ASSERT_SAME_TYPE(decltype(tv.begin()), std::counted_iterator<int*>);
ASSERT_SAME_TYPE(decltype(std::as_const(tv).begin()), std::counted_iterator<int*>);
}
+ // non simple-view<V> && !sized_range<V>
----------------
var-const wrote:
Nit: how about `s/non/!/` to make it uniform with `!sized_range`? I.e., `!simple-view<V> && !sized_range<V>`
https://github.com/llvm/llvm-project/pull/79085
More information about the libcxx-commits
mailing list