@@ -172,31 +172,47 @@ struct memcopy_test {
172172 static constexpr int expected_input_long[] = {13 , 55 , 12345 , 42 };
173173
174174 static void call () {
175+ using ranges::uninitialized_copy_n, ranges::uninitialized_copy_n_result, ranges::equal, ranges::iterator_t ;
175176 { // Validate range overload
176177 int input[] = {13 , 55 , 12345 , 42 };
177178 int output[] = {-1 , -1 , -1 , -1 };
178-
179- ranges::uninitialized_copy_n (input, 3 , begin (output), end (output));
180- assert (ranges::equal (input, expected_input));
181- assert (ranges::equal (output, expected_output));
179+ span<int > wrapped_input{input};
180+ span<int > wrapped_output{output};
181+
182+ const same_as<uninitialized_copy_n_result<iterator_t <span<int >>, iterator_t <span<int >>>> auto result =
183+ uninitialized_copy_n (wrapped_input.begin (), 3 , begin (wrapped_output), end (wrapped_output));
184+ assert (next (result.in ) == end (wrapped_input));
185+ assert (next (result.out ) == end (wrapped_output));
186+ assert (equal (input, expected_input));
187+ assert (equal (output, expected_output));
182188 }
183189
184190 { // Validate shorter input
185191 int input[] = {13 , 55 };
186192 int output[] = {-1 , -1 , -1 , -1 };
187-
188- ranges::uninitialized_copy_n (input, 2 , begin (output), end (output));
189- assert (ranges::equal (input, expected_input_short));
190- assert (ranges::equal (output, expected_output_long));
193+ span<int > wrapped_input{input};
194+ span<int > wrapped_output{output};
195+
196+ const same_as<uninitialized_copy_n_result<iterator_t <span<int >>, iterator_t <span<int >>>> auto result =
197+ uninitialized_copy_n (wrapped_input.begin (), 2 , begin (wrapped_output), end (wrapped_output));
198+ assert (result.in == end (wrapped_input));
199+ assert (next (result.out , 2 ) == end (wrapped_output));
200+ assert (equal (input, expected_input_short));
201+ assert (equal (output, expected_output_long));
191202 }
192203
193204 { // Validate shorter output
194205 int input[] = {13 , 55 , 12345 , 42 };
195206 int output[] = {-1 , -1 };
196-
197- ranges::uninitialized_copy_n (input, 3 , begin (output), end (output));
198- assert (ranges::equal (input, expected_input));
199- assert (ranges::equal (output, expected_input_short));
207+ span<int > wrapped_input{input};
208+ span<int > wrapped_output{output};
209+
210+ const same_as<uninitialized_copy_n_result<iterator_t <span<int >>, iterator_t <span<int >>>> auto result =
211+ uninitialized_copy_n (wrapped_input.begin (), 2 , begin (wrapped_output), end (wrapped_output));
212+ assert (next (result.in , 2 ) == end (wrapped_input));
213+ assert (result.out == end (wrapped_output));
214+ assert (equal (input, expected_input));
215+ assert (equal (output, expected_input_short));
200216 }
201217 }
202218};
0 commit comments