diff --git a/impl/any_view/test/iterator/bidirectional.cpp b/impl/any_view/test/iterator/bidirectional.cpp index 26198e1..e4cd7c2 100644 --- a/impl/any_view/test/iterator/bidirectional.cpp +++ b/impl/any_view/test/iterator/bidirectional.cpp @@ -10,7 +10,7 @@ namespace { using AnyView = std::ranges::any_view; -using Iter = AnyView::any_iterator; +using Iter = std::ranges::iterator_t; static_assert(std::bidirectional_iterator); static_assert(!std::random_access_iterator); @@ -29,9 +29,10 @@ static_assert(std::same_as::difference_type, ptrdiff_t>); constexpr void basic() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); { std::same_as decltype(auto) r = *iter; assert(r == 1); @@ -56,9 +57,10 @@ constexpr void basic() { } constexpr void move() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(std::move(iter1)); assert(*iter1 == 1); @@ -75,9 +77,10 @@ constexpr void move() { } constexpr void copy() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(iter1); assert(*iter1 == 1); @@ -94,8 +97,10 @@ constexpr void copy() { } constexpr void equal() { - std::array v{1, 2, 3, 4, 5}; - Iter iter1(v.begin()); + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); + + Iter iter1 = v.begin(); Iter iter2(iter1); std::same_as decltype(auto) r = iter1 == iter2; @@ -106,9 +111,10 @@ constexpr void equal() { } constexpr void decrement() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); ++iter; ++iter; ++iter; diff --git a/impl/any_view/test/iterator/forward.cpp b/impl/any_view/test/iterator/forward.cpp index 02035aa..ebfe73f 100644 --- a/impl/any_view/test/iterator/forward.cpp +++ b/impl/any_view/test/iterator/forward.cpp @@ -9,7 +9,7 @@ namespace { using AnyView = std::ranges::any_view; -using Iter = AnyView::any_iterator; +using Iter = std::ranges::iterator_t; static_assert(std::forward_iterator); static_assert(!std::bidirectional_iterator); @@ -28,9 +28,10 @@ static_assert(std::same_as::difference_type, ptrdiff_t>); constexpr void basic() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); { std::same_as decltype(auto) r = *iter; assert(r == 1); @@ -55,9 +56,10 @@ constexpr void basic() { } constexpr void default_ctor() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); Iter iter1, iter2; @@ -69,9 +71,10 @@ constexpr void default_ctor() { } constexpr void move() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(std::move(iter1)); assert(*iter1 == 1); @@ -88,9 +91,10 @@ constexpr void move() { } constexpr void copy() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(iter1); assert(*iter1 == 1); @@ -107,8 +111,9 @@ constexpr void copy() { } constexpr void equal() { - std::array v{1, 2, 3, 4, 5}; - Iter iter1(v.begin()); + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); + Iter iter1 = v.begin(); Iter iter2(iter1); std::same_as decltype(auto) r = iter1 == iter2; diff --git a/impl/any_view/test/iterator/input.cpp b/impl/any_view/test/iterator/input.cpp index d58ce7b..77ee842 100644 --- a/impl/any_view/test/iterator/input.cpp +++ b/impl/any_view/test/iterator/input.cpp @@ -10,7 +10,7 @@ namespace { using AnyView = std::ranges::any_view; -using Iter = AnyView::any_iterator; +using Iter = std::ranges::iterator_t; static_assert(std::input_iterator); static_assert(!std::forward_iterator); @@ -24,9 +24,10 @@ concept has_iterator_category = requires() { typename T::iterator_category; }; static_assert(!has_iterator_category); constexpr void basic() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter =v.begin(); { std::same_as decltype(auto) r = *iter; assert(r == 1); @@ -51,9 +52,10 @@ constexpr void basic() { } constexpr void move() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(std::move(iter1)); assert(*iter1 == 1); diff --git a/impl/any_view/test/iterator/input_common.cpp b/impl/any_view/test/iterator/input_common.cpp index b77fe6f..31c70fd 100644 --- a/impl/any_view/test/iterator/input_common.cpp +++ b/impl/any_view/test/iterator/input_common.cpp @@ -11,7 +11,7 @@ namespace { using AnyView = std::ranges::any_view; -using Iter = AnyView::any_iterator; +using Iter = std::ranges::iterator_t; static_assert(std::input_iterator); static_assert(!std::forward_iterator); @@ -25,9 +25,10 @@ concept has_iterator_category = requires() { typename T::iterator_category; }; static_assert(!has_iterator_category); constexpr void basic() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); { std::same_as decltype(auto) r = *iter; assert(r == 1); @@ -52,9 +53,10 @@ constexpr void basic() { } constexpr void move() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(std::move(iter1)); assert(*iter1 == 1); @@ -71,9 +73,10 @@ constexpr void move() { } constexpr void copy() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(iter1); assert(*iter1 == 1); @@ -90,9 +93,11 @@ constexpr void copy() { } constexpr void equal() { - std::array v{1, 2, 3, 4, 5}; - Iter iter1(v.begin()); - Iter iter2(v.begin()); + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); + + Iter iter1 = v.begin(); + Iter iter2 = v.begin(); std::same_as decltype(auto) r = iter1 == iter2; assert(r); diff --git a/impl/any_view/test/iterator/random_access.cpp b/impl/any_view/test/iterator/random_access.cpp index 96c1a66..9fbad1c 100644 --- a/impl/any_view/test/iterator/random_access.cpp +++ b/impl/any_view/test/iterator/random_access.cpp @@ -10,7 +10,7 @@ namespace { using AnyView = std::ranges::any_view; -using Iter = AnyView::any_iterator; +using Iter = std::ranges::iterator_t; static_assert(std::random_access_iterator); static_assert(!std::contiguous_iterator); @@ -29,9 +29,10 @@ static_assert(std::same_as::difference_type, ptrdiff_t>); constexpr void basic() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); { std::same_as decltype(auto) r = *iter; assert(r == 1); @@ -56,9 +57,10 @@ constexpr void basic() { } constexpr void move() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(std::move(iter1)); assert(*iter1 == 1); @@ -75,9 +77,10 @@ constexpr void move() { } constexpr void copy() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter2(iter1); assert(*iter1 == 1); @@ -94,8 +97,10 @@ constexpr void copy() { } constexpr void equal() { - std::array v{1, 2, 3, 4, 5}; - Iter iter1(v.begin()); + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); + + Iter iter1 = v.begin(); Iter iter2(iter1); std::same_as decltype(auto) r = iter1 == iter2; @@ -106,9 +111,10 @@ constexpr void equal() { } constexpr void decrement() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); ++iter; ++iter; ++iter; @@ -129,9 +135,10 @@ constexpr void decrement() { } constexpr void random_access() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter(v.begin()); + Iter iter = v.begin(); { std::same_as decltype(auto) r = iter += 3; @@ -183,9 +190,10 @@ constexpr void random_access() { } constexpr void compare() { - std::array v{1, 2, 3, 4, 5}; + std::array a{1, 2, 3, 4, 5}; + AnyView v(std::views::all(a)); - Iter iter1(v.begin()); + Iter iter1 = v.begin(); Iter iter1_copy = iter1; Iter iter4(v.begin() + 3);