[libcxx-commits] [libcxx] 610ac8d - [libc++] [test] s/ContiguousView/MoveOnlyView/g. NFCI.
Arthur O'Dwyer via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 6 13:43:54 PDT 2021
Author: Arthur O'Dwyer
Date: 2021-10-06T16:43:03-04:00
New Revision: 610ac8dbcc16e85fe4b357f5d31919873a51ad27
URL: https://github.com/llvm/llvm-project/commit/610ac8dbcc16e85fe4b357f5d31919873a51ad27
DIFF: https://github.com/llvm/llvm-project/commit/610ac8dbcc16e85fe4b357f5d31919873a51ad27.diff
LOG: [libc++] [test] s/ContiguousView/MoveOnlyView/g. NFCI.
The unique (ha!) thing about this range type is that it's move-only.
Its contiguity is unsurprising (most of our test ranges are contiguous).
Discussed in D111231 but committed separately for clarity.
Added:
Modified:
libcxx/test/std/ranges/range.adaptors/range.common.view/base.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.common.view/begin.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.default.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.view.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.common.view/types.h
libcxx/test/std/ranges/range.adaptors/range.drop/base.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/ctor.default.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/end.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/general.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/size.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.drop/types.h
libcxx/test/std/ranges/range.adaptors/range.take/base.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/end.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.take/types.h
libcxx/test/std/ranges/range.adaptors/range.transform/adaptor.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/base.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/begin.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/end.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/arithmetic.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/base.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/plus_minus.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/subscript.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/size.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.transform/types.h
Removed:
################################################################################
diff --git a/libcxx/test/std/ranges/range.adaptors/range.common.view/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.common.view/base.pass.cpp
index 781934892527..6b53c201b107 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.common.view/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.common.view/base.pass.cpp
@@ -40,11 +40,11 @@ constexpr bool test() {
}
{
- ContiguousView view{buf, buf + 8};
- std::ranges::common_view<ContiguousView> common(std::move(view));
+ MoveOnlyView view{buf, buf + 8};
+ std::ranges::common_view<MoveOnlyView> common(std::move(view));
assert(std::move(common).base().begin_ == buf);
- ASSERT_SAME_TYPE(decltype(std::move(common).base()), ContiguousView);
+ ASSERT_SAME_TYPE(decltype(std::move(common).base()), MoveOnlyView);
static_assert(!hasLValueQualifiedBase(common));
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.common.view/begin.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.common.view/begin.pass.cpp
index 579d84e47c33..adf27459f4c8 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.common.view/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.common.view/begin.pass.cpp
@@ -79,8 +79,8 @@ int main(int, char**) {
}
{
- ContiguousView view{buf, buf + 8};
- std::ranges::common_view<ContiguousView> common(std::move(view));
+ MoveOnlyView view{buf, buf + 8};
+ std::ranges::common_view<MoveOnlyView> common(std::move(view));
using CommonIter = std::common_iterator<int*, sentinel_wrapper<int*>>;
std::same_as<CommonIter> auto begin = common.begin();
assert(begin == std::ranges::begin(view));
diff --git a/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.default.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.default.pass.cpp
index 484ca111be73..f8412f2b094c 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.default.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.default.pass.cpp
@@ -21,7 +21,7 @@
#include "types.h"
int main(int, char**) {
- static_assert(!std::default_initializable<std::ranges::common_view<ContiguousView>>);
+ static_assert(!std::default_initializable<std::ranges::common_view<MoveOnlyView>>);
static_assert( std::default_initializable<std::ranges::common_view<DefaultConstructibleView>>);
std::ranges::common_view<DefaultConstructibleView> common;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.view.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.view.pass.cpp
index a31f85f0a717..e3678df4c762 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.view.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.view.pass.cpp
@@ -24,8 +24,8 @@ constexpr bool test() {
int buf[8] = {1, 2, 3, 4, 5, 6, 7, 8};
{
- ContiguousView view{buf, buf + 8};
- std::ranges::common_view<ContiguousView> common(std::move(view));
+ MoveOnlyView view{buf, buf + 8};
+ std::ranges::common_view<MoveOnlyView> common(std::move(view));
assert(std::move(common).base().begin_ == buf);
}
@@ -45,8 +45,8 @@ int main(int, char**) {
// Can't compare common_iterator inside constexpr
{
int buf[8] = {1, 2, 3, 4, 5, 6, 7, 8};
- ContiguousView view{buf, buf + 8};
- std::ranges::common_view<ContiguousView> const common(std::move(view));
+ MoveOnlyView view{buf, buf + 8};
+ std::ranges::common_view<MoveOnlyView> const common(std::move(view));
assert(common.begin() == buf);
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.common.view/types.h b/libcxx/test/std/ranges/range.adaptors/range.common.view/types.h
index 98f62c01123f..698c5af73cda 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.common.view/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.common.view/types.h
@@ -23,18 +23,18 @@ struct DefaultConstructibleView : std::ranges::view_base {
static_assert(std::ranges::view<DefaultConstructibleView>);
static_assert(std::default_initializable<DefaultConstructibleView>);
-struct ContiguousView : std::ranges::view_base {
+struct MoveOnlyView : std::ranges::view_base {
int* begin_;
int* end_;
- constexpr explicit ContiguousView(int* b, int* e) : begin_(b), end_(e) { }
- constexpr ContiguousView(ContiguousView&&) = default;
- constexpr ContiguousView& operator=(ContiguousView&&) = default;
+ constexpr explicit MoveOnlyView(int* b, int* e) : begin_(b), end_(e) { }
+ constexpr MoveOnlyView(MoveOnlyView&&) = default;
+ constexpr MoveOnlyView& operator=(MoveOnlyView&&) = default;
constexpr int *begin() const { return begin_; }
constexpr auto end() const { return sentinel_wrapper<int*>(end_); }
};
-static_assert( std::ranges::view<ContiguousView>);
-static_assert( std::ranges::contiguous_range<ContiguousView>);
-static_assert(!std::copyable<ContiguousView>);
+static_assert( std::ranges::view<MoveOnlyView>);
+static_assert( std::ranges::contiguous_range<MoveOnlyView>);
+static_assert(!std::copyable<MoveOnlyView>);
struct CopyableView : std::ranges::view_base {
int* begin_;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/base.pass.cpp
index 62f33fac6652..3113fb4b7bba 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/base.pass.cpp
@@ -19,12 +19,12 @@
#include "types.h"
constexpr bool test() {
- std::ranges::drop_view<ContiguousView> dropView1;
+ std::ranges::drop_view<MoveOnlyView> dropView1;
auto base1 = std::move(dropView1).base();
assert(std::ranges::begin(base1) == globalBuff);
// Note: we should *not* drop two elements here.
- std::ranges::drop_view<ContiguousView> dropView2(ContiguousView{4}, 2);
+ std::ranges::drop_view<MoveOnlyView> dropView2(MoveOnlyView{4}, 2);
auto base2 = std::move(dropView2).base();
assert(std::ranges::begin(base2) == globalBuff + 4);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
index 433cffdb94cd..ca19ef2ba802 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
@@ -26,7 +26,7 @@ concept BeginInvocable = requires(std::ranges::drop_view<T> t) { t.begin(); };
constexpr bool test() {
// random_access_range<const V> && sized_range<const V>
- std::ranges::drop_view dropView1(ContiguousView(), 4);
+ std::ranges::drop_view dropView1(MoveOnlyView(), 4);
assert(dropView1.begin() == globalBuff + 4);
// !random_access_range<const V>
@@ -38,19 +38,19 @@ constexpr bool test() {
assert(dropView3.begin().base() == globalBuff + 4);
// random_access_range<const V> && sized_range<const V>
- std::ranges::drop_view dropView4(ContiguousView(), 8);
+ std::ranges::drop_view dropView4(MoveOnlyView(), 8);
assert(dropView4.begin() == globalBuff + 8);
// random_access_range<const V> && sized_range<const V>
- std::ranges::drop_view dropView5(ContiguousView(), 0);
+ std::ranges::drop_view dropView5(MoveOnlyView(), 0);
assert(dropView5.begin() == globalBuff);
// random_access_range<const V> && sized_range<const V>
- const std::ranges::drop_view dropView6(ContiguousView(), 0);
+ const std::ranges::drop_view dropView6(MoveOnlyView(), 0);
assert(dropView6.begin() == globalBuff);
// random_access_range<const V> && sized_range<const V>
- std::ranges::drop_view dropView7(ContiguousView(), 10);
+ std::ranges::drop_view dropView7(MoveOnlyView(), 10);
assert(dropView7.begin() == globalBuff + 8);
CountedView view8;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
index 022dbb34cb37..84575c9c1897 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
@@ -20,7 +20,7 @@
namespace ranges = std::ranges;
-static_assert(std::same_as<decltype(ranges::drop_view(ContiguousView(), 0)), ranges::drop_view<ContiguousView>>);
+static_assert(std::same_as<decltype(ranges::drop_view(MoveOnlyView(), 0)), ranges::drop_view<MoveOnlyView>>);
static_assert(std::same_as<decltype(ranges::drop_view(CopyableView(), 0)), ranges::drop_view<CopyableView>>);
static_assert(std::same_as<decltype(ranges::drop_view(ForwardView(), 0)), ranges::drop_view<ForwardView>>);
static_assert(std::same_as<decltype(ranges::drop_view(InputView(), 0)), ranges::drop_view<InputView>>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.default.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.default.pass.cpp
index fa1c46ccb9e9..379c38862b7f 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.default.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.default.pass.cpp
@@ -18,7 +18,7 @@
#include "types.h"
constexpr bool test() {
- std::ranges::drop_view<ContiguousView> dropView1;
+ std::ranges::drop_view<MoveOnlyView> dropView1;
assert(std::ranges::begin(dropView1) == globalBuff);
static_assert( std::is_default_constructible_v<std::ranges::drop_view<ForwardView>>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
index 8949da522ba1..415562f3e617 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
@@ -18,7 +18,7 @@
#include "types.h"
constexpr bool test() {
- std::ranges::drop_view dropView1(ContiguousView(), 4);
+ std::ranges::drop_view dropView1(MoveOnlyView(), 4);
assert(dropView1.size() == 4);
assert(dropView1.begin() == globalBuff + 4);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/end.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/end.pass.cpp
index 5354eed50cd4..cfff93e22901 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/end.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/end.pass.cpp
@@ -22,7 +22,7 @@
constexpr bool test() {
// range<const V>
- std::ranges::drop_view dropView1(ContiguousView(), 4);
+ std::ranges::drop_view dropView1(MoveOnlyView(), 4);
assert(dropView1.end() == globalBuff + 8);
// !simple-view<V>
@@ -30,7 +30,7 @@ constexpr bool test() {
assert(dropView2.end() == globalBuff + 8);
// range<const V>
- const std::ranges::drop_view dropView3(ContiguousView(), 0);
+ const std::ranges::drop_view dropView3(MoveOnlyView(), 0);
assert(dropView3.end() == globalBuff + 8);
// !simple-view<V>
@@ -38,7 +38,7 @@ constexpr bool test() {
assert(dropView4.end() == globalBuff + 8);
// range<const V>
- std::ranges::drop_view dropView5(ContiguousView(), 10);
+ std::ranges::drop_view dropView5(MoveOnlyView(), 10);
assert(dropView5.end() == globalBuff + 8);
return true;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/general.pass.cpp
index 44f778f811e5..f3560fada9f2 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/general.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/general.pass.cpp
@@ -28,10 +28,10 @@
template<class T>
concept ValidDropView = requires { typename std::ranges::drop_view<T>; };
-static_assert( ValidDropView<ContiguousView>);
+static_assert( ValidDropView<MoveOnlyView>);
static_assert(!ValidDropView<Range>);
-static_assert(!std::ranges::enable_borrowed_range<std::ranges::drop_view<ContiguousView>>);
+static_assert(!std::ranges::enable_borrowed_range<std::ranges::drop_view<MoveOnlyView>>);
static_assert( std::ranges::enable_borrowed_range<std::ranges::drop_view<BorrowableView>>);
template<std::ranges::view View>
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/size.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/size.pass.cpp
index a6721e903810..863814564522 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/size.pass.cpp
@@ -25,19 +25,19 @@ concept SizeInvocable = requires(std::ranges::drop_view<T> t) { t.size(); };
constexpr bool test() {
// sized_range<V>
- std::ranges::drop_view dropView1(ContiguousView(), 4);
+ std::ranges::drop_view dropView1(MoveOnlyView(), 4);
assert(dropView1.size() == 4);
// sized_range<V>
- std::ranges::drop_view dropView2(ContiguousView(), 0);
+ std::ranges::drop_view dropView2(MoveOnlyView(), 0);
assert(dropView2.size() == 8);
// sized_range<const V>
- const std::ranges::drop_view dropView3(ContiguousView(), 8);
+ const std::ranges::drop_view dropView3(MoveOnlyView(), 8);
assert(dropView3.size() == 0);
// sized_range<const V>
- const std::ranges::drop_view dropView4(ContiguousView(), 10);
+ const std::ranges::drop_view dropView4(MoveOnlyView(), 10);
assert(dropView4.size() == 0);
// Because ForwardView is not a sized_range.
diff --git a/libcxx/test/std/ranges/range.adaptors/range.drop/types.h b/libcxx/test/std/ranges/range.adaptors/range.drop/types.h
index 19c2a738c968..8a9612edcafc 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/types.h
@@ -14,17 +14,17 @@
int globalBuff[8];
-struct ContiguousView : std::ranges::view_base {
+struct MoveOnlyView : std::ranges::view_base {
int start_;
- constexpr explicit ContiguousView(int start = 0) : start_(start) {}
- constexpr ContiguousView(ContiguousView&&) = default;
- constexpr ContiguousView& operator=(ContiguousView&&) = default;
+ constexpr explicit MoveOnlyView(int start = 0) : start_(start) {}
+ constexpr MoveOnlyView(MoveOnlyView&&) = default;
+ constexpr MoveOnlyView& operator=(MoveOnlyView&&) = default;
constexpr int *begin() const { return globalBuff + start_; }
constexpr int *end() const { return globalBuff + 8; }
};
-static_assert( std::ranges::view<ContiguousView>);
-static_assert( std::ranges::contiguous_range<ContiguousView>);
-static_assert(!std::copyable<ContiguousView>);
+static_assert( std::ranges::view<MoveOnlyView>);
+static_assert( std::ranges::contiguous_range<MoveOnlyView>);
+static_assert(!std::copyable<MoveOnlyView>);
struct CopyableView : std::ranges::view_base {
int start_;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/base.pass.cpp
index fe0e0c3b37bd..c33396f96d65 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/base.pass.cpp
@@ -38,10 +38,10 @@ constexpr bool test() {
}
{
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 1);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 1);
assert(std::move(tv).base().ptr_ == buffer);
- ASSERT_SAME_TYPE(decltype(std::move(tv).base()), ContiguousView);
+ ASSERT_SAME_TYPE(decltype(std::move(tv).base()), MoveOnlyView);
static_assert(!hasLValueQualifiedBase(tv));
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
index 556542dce049..056817f1e7f4 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
@@ -52,13 +52,13 @@ constexpr bool test() {
// !sized_range
{
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.begin() == std::counted_iterator<int*>(buffer, 4));
ASSERT_SAME_TYPE(decltype(tv.begin()), std::counted_iterator<int*>);
}
{
- const std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ const std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.begin() == std::counted_iterator<int*>(buffer, 4));
ASSERT_SAME_TYPE(decltype(tv.begin()), std::counted_iterator<int*>);
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
index dabd5034f85a..e56952172dc7 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
@@ -30,7 +30,7 @@ constexpr bool test() {
}
{
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 1);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 1);
assert(std::move(tv).base().ptr_ == buffer);
assert(std::ranges::next(tv.begin(), 1) == tv.end()); // Checking we have correct size.
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/end.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/end.pass.cpp
index 046e739bc885..5da1279315da 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/end.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/end.pass.cpp
@@ -52,7 +52,7 @@ constexpr bool test() {
// !sized_range
{
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.end() == std::ranges::next(tv.begin(), 4));
// The <sentinel> type.
@@ -61,7 +61,7 @@ constexpr bool test() {
}
{
- const std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 5);
+ const std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 5);
assert(tv.end() == std::ranges::next(tv.begin(), 5));
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
index 8a5a6b034da5..cd666f19d3a2 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
@@ -27,13 +27,13 @@ constexpr bool test() {
auto sw = sentinel_wrapper<int *>(buffer + 8); // Note: not 4, but that's OK.
{
- const std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ const std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.end().base().base() == sw.base());
ASSERT_SAME_TYPE(decltype(tv.end().base()), sentinel_wrapper<int *>);
}
{
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.end().base().base() == sw.base());
ASSERT_SAME_TYPE(decltype(tv.end().base()), sentinel_wrapper<int *>);
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
index ea762e23c3e0..842659ccdc93 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
@@ -27,13 +27,13 @@ constexpr bool test() {
{
// Test the default ctor.
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(decltype(tv.end()){} == std::ranges::next(tv.begin(), 4));
}
{
- std::ranges::take_view<ContiguousView> nonConst(ContiguousView{buffer}, 5);
- const std::ranges::take_view<ContiguousView> tvConst(ContiguousView{buffer}, 5);
+ std::ranges::take_view<MoveOnlyView> nonConst(MoveOnlyView{buffer}, 5);
+ const std::ranges::take_view<MoveOnlyView> tvConst(MoveOnlyView{buffer}, 5);
auto sent1 = nonConst.end();
// Convert to const. Note, we cannot go the other way.
std::remove_cv_t<decltype(tvConst.end())> sent2 = sent1;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp
index a4fc7ca91ae4..47fbaafbed5a 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp
@@ -27,21 +27,21 @@ constexpr bool test() {
{
{
- const std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ const std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.end() == std::ranges::next(tv.begin(), 4));
assert(std::ranges::next(tv.begin(), 4) == tv.end());
}
{
- std::ranges::take_view<ContiguousView> tv(ContiguousView{buffer}, 4);
+ std::ranges::take_view<MoveOnlyView> tv(MoveOnlyView{buffer}, 4);
assert(tv.end() == std::ranges::next(tv.begin(), 4));
assert(std::ranges::next(tv.begin(), 4) == tv.end());
}
}
{
- std::ranges::take_view<ContiguousView> tvNonConst(ContiguousView{buffer}, 4);
- const std::ranges::take_view<ContiguousView> tvConst(ContiguousView{buffer}, 4);
+ std::ranges::take_view<MoveOnlyView> tvNonConst(MoveOnlyView{buffer}, 4);
+ const std::ranges::take_view<MoveOnlyView> tvConst(MoveOnlyView{buffer}, 4);
assert(tvNonConst.end() == std::ranges::next(tvConst.begin(), 4));
assert(std::ranges::next(tvConst.begin(), 4) == tvNonConst.end());
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/types.h b/libcxx/test/std/ranges/range.adaptors/range.take/types.h
index 81952c52a767..bd3336c6f04d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/types.h
@@ -7,19 +7,19 @@
#include "test_iterators.h"
#include "test_range.h"
-struct ContiguousView : std::ranges::view_base {
+struct MoveOnlyView : std::ranges::view_base {
int *ptr_;
- constexpr explicit ContiguousView(int* ptr) : ptr_(ptr) {}
- ContiguousView(ContiguousView&&) = default;
- ContiguousView& operator=(ContiguousView&&) = default;
+ constexpr explicit MoveOnlyView(int* ptr) : ptr_(ptr) {}
+ MoveOnlyView(MoveOnlyView&&) = default;
+ MoveOnlyView& operator=(MoveOnlyView&&) = default;
constexpr int* begin() const {return ptr_;}
constexpr sentinel_wrapper<int*> end() const {return sentinel_wrapper<int*>{ptr_ + 8};}
};
-static_assert( std::ranges::view<ContiguousView>);
-static_assert( std::ranges::contiguous_range<ContiguousView>);
-static_assert(!std::copyable<ContiguousView>);
+static_assert( std::ranges::view<MoveOnlyView>);
+static_assert( std::ranges::contiguous_range<MoveOnlyView>);
+static_assert(!std::copyable<MoveOnlyView>);
struct CopyableView : std::ranges::view_base {
int *ptr_;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/adaptor.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/adaptor.pass.cpp
index 7c3b27bb5739..ce1a00e3177d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/adaptor.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/adaptor.pass.cpp
@@ -39,8 +39,8 @@ constexpr bool test() {
// Test `views::transform(f)(v)`
{
{
- using Result = std::ranges::transform_view<ContiguousView, PlusOne>;
- std::same_as<Result> auto result = std::views::transform(PlusOne{})(ContiguousView{buff});
+ using Result = std::ranges::transform_view<MoveOnlyView, PlusOne>;
+ std::same_as<Result> auto result = std::views::transform(PlusOne{})(MoveOnlyView{buff});
assert(result.begin().base() == buff);
assert(result[0] == 1);
assert(result[1] == 2);
@@ -48,8 +48,8 @@ constexpr bool test() {
}
{
auto const partial = std::views::transform(PlusOne{});
- using Result = std::ranges::transform_view<ContiguousView, PlusOne>;
- std::same_as<Result> auto result = partial(ContiguousView{buff});
+ using Result = std::ranges::transform_view<MoveOnlyView, PlusOne>;
+ std::same_as<Result> auto result = partial(MoveOnlyView{buff});
assert(result.begin().base() == buff);
assert(result[0] == 1);
assert(result[1] == 2);
@@ -60,8 +60,8 @@ constexpr bool test() {
// Test `v | views::transform(f)`
{
{
- using Result = std::ranges::transform_view<ContiguousView, PlusOne>;
- std::same_as<Result> auto result = ContiguousView{buff} | std::views::transform(PlusOne{});
+ using Result = std::ranges::transform_view<MoveOnlyView, PlusOne>;
+ std::same_as<Result> auto result = MoveOnlyView{buff} | std::views::transform(PlusOne{});
assert(result.begin().base() == buff);
assert(result[0] == 1);
assert(result[1] == 2);
@@ -69,8 +69,8 @@ constexpr bool test() {
}
{
auto const partial = std::views::transform(PlusOne{});
- using Result = std::ranges::transform_view<ContiguousView, PlusOne>;
- std::same_as<Result> auto result = ContiguousView{buff} | partial;
+ using Result = std::ranges::transform_view<MoveOnlyView, PlusOne>;
+ std::same_as<Result> auto result = MoveOnlyView{buff} | partial;
assert(result.begin().base() == buff);
assert(result[0] == 1);
assert(result[1] == 2);
@@ -80,8 +80,8 @@ constexpr bool test() {
// Test `views::transform(v, f)`
{
- using Result = std::ranges::transform_view<ContiguousView, PlusOne>;
- std::same_as<Result> auto result = std::views::transform(ContiguousView{buff}, PlusOne{});
+ using Result = std::ranges::transform_view<MoveOnlyView, PlusOne>;
+ std::same_as<Result> auto result = std::views::transform(MoveOnlyView{buff}, PlusOne{});
assert(result.begin().base() == buff);
assert(result[0] == 1);
assert(result[1] == 2);
@@ -101,8 +101,8 @@ constexpr bool test() {
// Test `adaptor | views::transform(f)`
{
{
- using Result = std::ranges::transform_view<std::ranges::transform_view<ContiguousView, PlusOne>, TimesTwo>;
- std::same_as<Result> auto result = ContiguousView{buff} | std::views::transform(PlusOne{}) | std::views::transform(TimesTwo{});
+ using Result = std::ranges::transform_view<std::ranges::transform_view<MoveOnlyView, PlusOne>, TimesTwo>;
+ std::same_as<Result> auto result = MoveOnlyView{buff} | std::views::transform(PlusOne{}) | std::views::transform(TimesTwo{});
assert(result.begin().base().base() == buff);
assert(result[0] == 2);
assert(result[1] == 4);
@@ -110,8 +110,8 @@ constexpr bool test() {
}
{
auto const partial = std::views::transform(PlusOne{}) | std::views::transform(TimesTwo{});
- using Result = std::ranges::transform_view<std::ranges::transform_view<ContiguousView, PlusOne>, TimesTwo>;
- std::same_as<Result> auto result = ContiguousView{buff} | partial;
+ using Result = std::ranges::transform_view<std::ranges::transform_view<MoveOnlyView, PlusOne>, TimesTwo>;
+ std::same_as<Result> auto result = MoveOnlyView{buff} | partial;
assert(result.begin().base().base() == buff);
assert(result[0] == 2);
assert(result[1] == 4);
@@ -124,15 +124,15 @@ constexpr bool test() {
struct NotAView { };
struct NotInvocable { };
- static_assert(!CanBePiped<ContiguousView, decltype(std::views::transform)>);
- static_assert( CanBePiped<ContiguousView, decltype(std::views::transform(PlusOne{}))>);
+ static_assert(!CanBePiped<MoveOnlyView, decltype(std::views::transform)>);
+ static_assert( CanBePiped<MoveOnlyView, decltype(std::views::transform(PlusOne{}))>);
static_assert(!CanBePiped<NotAView, decltype(std::views::transform(PlusOne{}))>);
- static_assert(!CanBePiped<ContiguousView, decltype(std::views::transform(NotInvocable{}))>);
+ static_assert(!CanBePiped<MoveOnlyView, decltype(std::views::transform(NotInvocable{}))>);
static_assert(!std::is_invocable_v<decltype(std::views::transform)>);
- static_assert(!std::is_invocable_v<decltype(std::views::transform), PlusOne, ContiguousView>);
- static_assert( std::is_invocable_v<decltype(std::views::transform), ContiguousView, PlusOne>);
- static_assert(!std::is_invocable_v<decltype(std::views::transform), ContiguousView, PlusOne, PlusOne>);
+ static_assert(!std::is_invocable_v<decltype(std::views::transform), PlusOne, MoveOnlyView>);
+ static_assert( std::is_invocable_v<decltype(std::views::transform), MoveOnlyView, PlusOne>);
+ static_assert(!std::is_invocable_v<decltype(std::views::transform), MoveOnlyView, PlusOne, PlusOne>);
static_assert(!std::is_invocable_v<decltype(std::views::transform), NonCopyableFunction>);
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/base.pass.cpp
index 6e9572d12ada..ca61481c5cab 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/base.pass.cpp
@@ -20,9 +20,9 @@
constexpr bool test() {
{
- std::ranges::transform_view<ContiguousView, PlusOne> transformView;
- ContiguousView base = std::move(transformView).base();
- ASSERT_SAME_TYPE(ContiguousView, decltype(std::move(transformView).base()));
+ std::ranges::transform_view<MoveOnlyView, PlusOne> transformView;
+ MoveOnlyView base = std::move(transformView).base();
+ ASSERT_SAME_TYPE(MoveOnlyView, decltype(std::move(transformView).base()));
assert(std::ranges::begin(base) == globalBuff);
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/begin.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/begin.pass.cpp
index b4665a5b74f4..af13da520d7f 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/begin.pass.cpp
@@ -27,7 +27,7 @@ constexpr bool test() {
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
{
- std::ranges::transform_view transformView(ContiguousView{buff}, PlusOneMutable{});
+ std::ranges::transform_view transformView(MoveOnlyView{buff}, PlusOneMutable{});
assert(transformView.begin().base() == buff);
assert(*transformView.begin() == 1);
}
@@ -45,11 +45,11 @@ constexpr bool test() {
}
{
- const std::ranges::transform_view transformView(ContiguousView{buff}, PlusOne{});
+ const std::ranges::transform_view transformView(MoveOnlyView{buff}, PlusOne{});
assert(*transformView.begin() == 1);
}
- static_assert(!BeginInvocable<const std::ranges::transform_view<ContiguousView, PlusOneMutable>>);
+ static_assert(!BeginInvocable<const std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>);
return true;
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/end.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/end.pass.cpp
index 9c11ef6469b6..c933e44f1a78 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/end.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/end.pass.cpp
@@ -32,7 +32,7 @@ concept EndIsIter = requires(T t) { ++t.end(); };
constexpr bool test() {
{
- std::ranges::transform_view transformView(ContiguousView{}, PlusOneMutable{});
+ std::ranges::transform_view transformView(MoveOnlyView{}, PlusOneMutable{});
assert(transformView.end().base() == globalBuff + 8);
}
@@ -47,21 +47,21 @@ constexpr bool test() {
}
{
- const std::ranges::transform_view transformView(ContiguousView{}, PlusOne{});
+ const std::ranges::transform_view transformView(MoveOnlyView{}, PlusOne{});
assert(transformView.end().base() == globalBuff + 8);
}
- static_assert(!EndInvocable<const std::ranges::transform_view<ContiguousView, PlusOneMutable>>);
- static_assert( EndInvocable< std::ranges::transform_view<ContiguousView, PlusOneMutable>>);
- static_assert( EndInvocable<const std::ranges::transform_view<ContiguousView, PlusOne>>);
+ static_assert(!EndInvocable<const std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>);
+ static_assert( EndInvocable< std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>);
+ static_assert( EndInvocable<const std::ranges::transform_view<MoveOnlyView, PlusOne>>);
static_assert(!EndInvocable<const std::ranges::transform_view<InputView, PlusOneMutable>>);
static_assert( EndInvocable< std::ranges::transform_view<InputView, PlusOneMutable>>);
static_assert( EndInvocable<const std::ranges::transform_view<InputView, PlusOne>>);
static_assert(!EndIsIter<const std::ranges::transform_view<InputView, PlusOne>>);
static_assert(!EndIsIter< std::ranges::transform_view<InputView, PlusOneMutable>>);
- static_assert( EndIsIter<const std::ranges::transform_view<ContiguousView, PlusOne>>);
- static_assert( EndIsIter< std::ranges::transform_view<ContiguousView, PlusOneMutable>>);
+ static_assert( EndIsIter<const std::ranges::transform_view<MoveOnlyView, PlusOne>>);
+ static_assert( EndIsIter< std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>);
return true;
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
index aec7143903e4..6dd80025289c 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
@@ -32,9 +32,9 @@ template<class T, class F>
concept ValidTransformView = requires { typename std::ranges::transform_view<T, F>; };
struct BadFunction { };
-static_assert( ValidTransformView<ContiguousView, PlusOne>);
+static_assert( ValidTransformView<MoveOnlyView, PlusOne>);
static_assert(!ValidTransformView<Range, PlusOne>);
-static_assert(!ValidTransformView<ContiguousView, BadFunction>);
+static_assert(!ValidTransformView<MoveOnlyView, BadFunction>);
template<std::ranges::range R>
auto toUpper(R range) {
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/arithmetic.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/arithmetic.pass.cpp
index cde7431bd82a..61aa6f31cb8b 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/arithmetic.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/arithmetic.pass.cpp
@@ -18,7 +18,7 @@
#include "../types.h"
constexpr bool test() {
- std::ranges::transform_view<ContiguousView, PlusOne> transformView;
+ std::ranges::transform_view<MoveOnlyView, PlusOne> transformView;
auto iter = std::move(transformView).begin();
assert((++iter).base() == globalBuff + 1);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/base.pass.cpp
index f60ed2a5c821..a69739647d6d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/base.pass.cpp
@@ -24,7 +24,7 @@ concept BaseInvocable = requires(std::ranges::iterator_t<std::ranges::transform_
constexpr bool test() {
{
- std::ranges::transform_view<ContiguousView, PlusOneMutable> transformView;
+ std::ranges::transform_view<MoveOnlyView, PlusOneMutable> transformView;
auto iter = std::move(transformView).begin();
ASSERT_SAME_TYPE(int*, decltype(iter.base()));
assert(iter.base() == globalBuff);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.pass.cpp
index 5e333f8d8d1f..a64acb51171e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.pass.cpp
@@ -57,15 +57,15 @@ struct IterNoDefaultInitView : std::ranges::view_base {
};
constexpr bool test() {
- std::ranges::transform_view<ContiguousView, PlusOne> transformView;
+ std::ranges::transform_view<MoveOnlyView, PlusOne> transformView;
auto iter = std::move(transformView).begin();
- std::ranges::iterator_t<std::ranges::transform_view<ContiguousView, PlusOne>> i2(iter);
+ std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOne>> i2(iter);
(void)i2;
- std::ranges::iterator_t<const std::ranges::transform_view<ContiguousView, PlusOne>> constIter(iter);
+ std::ranges::iterator_t<const std::ranges::transform_view<MoveOnlyView, PlusOne>> constIter(iter);
(void)constIter;
- static_assert( std::default_initializable<std::ranges::iterator_t<std::ranges::transform_view<ContiguousView, PlusOne>>>);
+ static_assert( std::default_initializable<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOne>>>);
static_assert(!std::default_initializable<std::ranges::iterator_t<std::ranges::transform_view<IterNoDefaultInitView, PlusOne>>>);
return true;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp
index f1bc26d152a5..93b28e9da087 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp
@@ -20,40 +20,40 @@
int main(int, char**) {
{
int buff[] = {0, 1, 2, 3, 4, 5, 6, 7};
- using View = std::ranges::transform_view<ContiguousView, PlusOne>;
- View transformView(ContiguousView{buff}, PlusOne{});
+ using View = std::ranges::transform_view<MoveOnlyView, PlusOne>;
+ View transformView(MoveOnlyView{buff}, PlusOne{});
assert(*transformView.begin() == 1);
static_assert(!noexcept(*std::declval<std::ranges::iterator_t<View>>()));
ASSERT_SAME_TYPE(int, decltype(*std::declval<View>().begin()));
}
{
int buff[] = {0, 1, 2, 3, 4, 5, 6, 7};
- using View = std::ranges::transform_view<ContiguousView, PlusOneMutable>;
- View transformView(ContiguousView{buff}, PlusOneMutable{});
+ using View = std::ranges::transform_view<MoveOnlyView, PlusOneMutable>;
+ View transformView(MoveOnlyView{buff}, PlusOneMutable{});
assert(*transformView.begin() == 1);
static_assert(!noexcept(*std::declval<std::ranges::iterator_t<View>>()));
ASSERT_SAME_TYPE(int, decltype(*std::declval<View>().begin()));
}
{
int buff[] = {0, 1, 2, 3, 4, 5, 6, 7};
- using View = std::ranges::transform_view<ContiguousView, PlusOneNoexcept>;
- View transformView(ContiguousView{buff}, PlusOneNoexcept{});
+ using View = std::ranges::transform_view<MoveOnlyView, PlusOneNoexcept>;
+ View transformView(MoveOnlyView{buff}, PlusOneNoexcept{});
assert(*transformView.begin() == 1);
static_assert(noexcept(*std::declval<std::ranges::iterator_t<View>>()));
ASSERT_SAME_TYPE(int, decltype(*std::declval<View>().begin()));
}
{
int buff[] = {0, 1, 2, 3, 4, 5, 6, 7};
- using View = std::ranges::transform_view<ContiguousView, Increment>;
- View transformView(ContiguousView{buff}, Increment{});
+ using View = std::ranges::transform_view<MoveOnlyView, Increment>;
+ View transformView(MoveOnlyView{buff}, Increment{});
assert(*transformView.begin() == 1);
static_assert(!noexcept(*std::declval<std::ranges::iterator_t<View>>()));
ASSERT_SAME_TYPE(int&, decltype(*std::declval<View>().begin()));
}
{
int buff[] = {0, 1, 2, 3, 4, 5, 6, 7};
- using View = std::ranges::transform_view<ContiguousView, IncrementRvalueRef>;
- View transformView(ContiguousView{buff}, IncrementRvalueRef{});
+ using View = std::ranges::transform_view<MoveOnlyView, IncrementRvalueRef>;
+ View transformView(MoveOnlyView{buff}, IncrementRvalueRef{});
assert(*transformView.begin() == 1);
static_assert(!noexcept(*std::declval<std::ranges::iterator_t<View>>()));
ASSERT_SAME_TYPE(int&&, decltype(*std::declval<View>().begin()));
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
index 85a46d99e490..4ec70792d07e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
@@ -21,7 +21,7 @@ constexpr bool test() {
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
{
- std::ranges::transform_view transformView(ContiguousView{buff}, PlusOneMutable{});
+ std::ranges::transform_view transformView(MoveOnlyView{buff}, PlusOneMutable{});
auto iter = transformView.begin();
static_assert(!noexcept(std::ranges::iter_move(iter)));
@@ -34,9 +34,9 @@ constexpr bool test() {
{
static_assert( noexcept(std::ranges::iter_move(
- std::declval<std::ranges::iterator_t<std::ranges::transform_view<ContiguousView, PlusOneNoexcept>>&>())));
+ std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneNoexcept>>&>())));
static_assert(!noexcept(std::ranges::iter_move(
- std::declval<std::ranges::iterator_t<std::ranges::transform_view<ContiguousView, PlusOneMutable>>&>())));
+ std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>&>())));
}
return true;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/plus_minus.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/plus_minus.pass.cpp
index 4a97d75958a9..9baff10cc034 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/plus_minus.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/plus_minus.pass.cpp
@@ -18,9 +18,9 @@
#include "../types.h"
constexpr bool test() {
- std::ranges::transform_view<ContiguousView, PlusOneMutable> transformView1;
+ std::ranges::transform_view<MoveOnlyView, PlusOneMutable> transformView1;
auto iter1 = std::move(transformView1).begin();
- std::ranges::transform_view<ContiguousView, PlusOneMutable> transformView2;
+ std::ranges::transform_view<MoveOnlyView, PlusOneMutable> transformView2;
auto iter2 = std::move(transformView2).begin();
iter1 += 4;
assert((iter1 + 1).base() == globalBuff + 5);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/subscript.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/subscript.pass.cpp
index 567f646fbd14..56c223de0caa 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/subscript.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/subscript.pass.cpp
@@ -19,15 +19,15 @@
constexpr bool test() {
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
- std::ranges::transform_view transformView1(ContiguousView{buff}, PlusOneMutable{});
+ std::ranges::transform_view transformView1(MoveOnlyView{buff}, PlusOneMutable{});
auto iter1 = std::move(transformView1).begin() + 1;
assert(iter1[0] == 2);
assert(iter1[4] == 6);
static_assert(!noexcept(
- std::declval<std::ranges::iterator_t<std::ranges::transform_view<ContiguousView, PlusOneMutable>>>()[0]));
+ std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>>()[0]));
static_assert( noexcept(
- std::declval<std::ranges::iterator_t<std::ranges::transform_view<ContiguousView, PlusOneNoexcept>>>()[0]));
+ std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneNoexcept>>>()[0]));
ASSERT_SAME_TYPE(
int,
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
index de7747023f5a..7118bb05ca1d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
@@ -29,7 +29,7 @@ constexpr bool test() {
static_assert(std::same_as<std::iterator_traits<int*>::iterator_concept, std::contiguous_iterator_tag>);
static_assert(std::same_as<std::iterator_traits<int*>::iterator_category, std::random_access_iterator_tag>);
- using TView = std::ranges::transform_view<ContiguousView, Increment>;
+ using TView = std::ranges::transform_view<MoveOnlyView, Increment>;
using TIter = std::ranges::iterator_t<TView>;
static_assert(std::same_as<typename TIter::iterator_concept, std::random_access_iterator_tag>);
static_assert(std::same_as<typename TIter::iterator_category, std::random_access_iterator_tag>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/size.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/size.pass.cpp
index 0402d44f6644..9da0146ae63f 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/size.pass.cpp
@@ -23,12 +23,12 @@ concept SizeInvocable = requires(T t) { t.size(); };
constexpr bool test() {
{
- std::ranges::transform_view transformView(ContiguousView{}, PlusOne{});
+ std::ranges::transform_view transformView(MoveOnlyView{}, PlusOne{});
assert(transformView.size() == 8);
}
{
- const std::ranges::transform_view transformView(ContiguousView{globalBuff, 4}, PlusOne{});
+ const std::ranges::transform_view transformView(MoveOnlyView{globalBuff, 4}, PlusOne{});
assert(transformView.size() == 4);
}
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/types.h b/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
index 24563719cf56..3c1ed0f564a8 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
@@ -15,18 +15,18 @@
int globalBuff[8] = {0,1,2,3,4,5,6,7};
-struct ContiguousView : std::ranges::view_base {
+struct MoveOnlyView : std::ranges::view_base {
int start_;
int *ptr_;
- constexpr explicit ContiguousView(int* ptr = globalBuff, int start = 0) : start_(start), ptr_(ptr) {}
- constexpr ContiguousView(ContiguousView&&) = default;
- constexpr ContiguousView& operator=(ContiguousView&&) = default;
+ constexpr explicit MoveOnlyView(int* ptr = globalBuff, int start = 0) : start_(start), ptr_(ptr) {}
+ constexpr MoveOnlyView(MoveOnlyView&&) = default;
+ constexpr MoveOnlyView& operator=(MoveOnlyView&&) = default;
constexpr int *begin() const { return ptr_ + start_; }
constexpr int *end() const { return ptr_ + 8; }
};
-static_assert( std::ranges::view<ContiguousView>);
-static_assert( std::ranges::contiguous_range<ContiguousView>);
-static_assert(!std::copyable<ContiguousView>);
+static_assert( std::ranges::view<MoveOnlyView>);
+static_assert( std::ranges::contiguous_range<MoveOnlyView>);
+static_assert(!std::copyable<MoveOnlyView>);
struct CopyableView : std::ranges::view_base {
int start_;
More information about the libcxx-commits
mailing list