11#include < algorithm>
22#include < concepts>
33#include < cstddef>
4- #include < ranges>
54#include < stdexcept>
65#include < string>
76#include < string_view>
@@ -66,9 +65,12 @@ void test_list_initialization_in_function_call(
6665 ystdlib::containers::Array<PolymorphicConstructors> const & arr,
6766 std::vector<size_t > const & data
6867) {
69- REQUIRE (std::ranges::equal (
70- arr | std::views::transform ([](auto const & obj) { return obj.get_value (); }),
71- data
68+ REQUIRE (std::equal (
69+ arr.begin (),
70+ arr.end (),
71+ data.begin (),
72+ data.end (),
73+ [](auto const & obj, size_t v) { return obj.get_value () == v; }
7274 ));
7375}
7476} // namespace
@@ -88,7 +90,7 @@ TEST_CASE("test_array_reference", "[containers][Array]") {
8890 arr.at (idx) = idx;
8991 }
9092 auto const & arr_const_ref = arr;
91- REQUIRE (std::ranges:: equal (arr, arr_const_ref));
93+ REQUIRE (std::equal (arr. begin (), arr. end (), arr_const_ref. begin (), arr_const_ref. end () ));
9294}
9395
9496TEST_CASE (" test_array_ranged_copy" , " [containers][Array]" ) {
@@ -97,8 +99,8 @@ TEST_CASE("test_array_ranged_copy", "[containers][Array]") {
9799 vec.push_back (idx);
98100 }
99101 Array<size_t > arr (cBufferSize);
100- std::ranges:: copy (vec, arr.begin ());
101- REQUIRE (std::ranges:: equal (vec, arr));
102+ std::copy (vec. begin (), vec. end () , arr.begin ());
103+ REQUIRE (std::equal (vec. cbegin (), vec. cend (), arr. begin (), arr. end () ));
102104}
103105
104106TEST_CASE (" test_array_movable" , " [containers][Array]" ) {
@@ -109,7 +111,12 @@ TEST_CASE("test_array_movable", "[containers][Array]") {
109111 reference_array.at (idx) = idx;
110112 }
111113 auto const arr_moved{std::move (arr)};
112- REQUIRE (std::ranges::equal (reference_array, arr_moved));
114+ REQUIRE (std::equal (
115+ reference_array.begin (),
116+ reference_array.end (),
117+ arr_moved.begin (),
118+ arr_moved.end ()
119+ ));
113120}
114121
115122TEST_CASE (" test_array_illegal_access" , " [containers][Array]" ) {
@@ -143,8 +150,8 @@ TEMPLATE_TEST_CASE(
143150) {
144151 REQUIRE (std::is_fundamental_v<TestType>);
145152 Array<TestType> arr (cBufferSize);
146- std::ranges:: for_each (arr, [](auto const & p) -> void {
147- REQUIRE (( static_cast <TestType>(0 ) == p) );
153+ std::for_each (arr. begin (), arr. end (), [](auto const & p) {
154+ REQUIRE (static_cast <TestType>(0 ) == p);
148155 });
149156}
150157
@@ -158,7 +165,7 @@ TEST_CASE("test_array_list_initialization", "[containers][Array]") {
158165 vec{" yscope" , " clp" , " ystdlib" , " ystdlib::containers::Array" , " default_initializable" };
159166 Array<std::string> const
160167 arr{" yscope" , " clp" , " ystdlib" , " ystdlib::containers::Array" , " default_initializable" };
161- REQUIRE (std::ranges:: equal (vec, arr));
168+ REQUIRE (std::equal (vec. cbegin (), vec. cend (), arr. begin (), arr. end () ));
162169
163170 // Test polymorphic list initialization
164171 REQUIRE (std::is_copy_constructible_v<PolymorphicConstructors>);
@@ -174,10 +181,12 @@ TEST_CASE("test_array_list_initialization", "[containers][Array]") {
174181 cTestNum0,
175182 std::string{cTestStr},
176183 ExplicitConstructor{cTestNum1}};
177- REQUIRE (std::ranges::equal (
178- list_init_arr
179- | std::views::transform ([](auto const & obj) { return obj.get_value (); }),
180- data
184+ REQUIRE (std::equal (
185+ list_init_arr.begin (),
186+ list_init_arr.end (),
187+ data.cbegin (),
188+ data.cend (),
189+ [](auto const & obj, auto const & v) { return obj.get_value () == v; }
181190 ));
182191 }
183192
0 commit comments