File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
libcxx/test/std/ranges/range.adaptors/range.concat/iterator Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ // ===----------------------------------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ // REQUIRES: has-unix-headers, std-at-least-c++26
10
+
11
+ #include < ranges>
12
+ #include < cassert>
13
+ #include < vector>
14
+
15
+ constexpr bool test () {
16
+ std::vector<int > v1 = {1 , 2 , 3 };
17
+ std::vector<int > v2 = {4 , 5 , 6 };
18
+ auto cv = std::views::concat (v1, v2);
19
+ static_assert (std::random_access_iterator<decltype (cv.begin ())>);
20
+ assert (cv[0 ] == 1 );
21
+ assert (cv[2 ] == 3 );
22
+ assert (cv[3 ] == 4 );
23
+ assert (cv[5 ] == 6 );
24
+ return true ;
25
+ }
26
+
27
+ int main (int , char **) {
28
+ test ();
29
+ static_assert (test ());
30
+
31
+ return 0 ;
32
+ }
You can’t perform that action at this time.
0 commit comments