1#include <cstdio>
2#include <ranges>
3#include <string>
4#include <vector>
5
6using string_vec = std::vector<std::string>;
7
8string_vec svec{"First", "Second", "Third", "Fourth"};
9
10struct Foo {
11 string_vec vec = svec;
12};
13
14int main() {
15 {
16 auto single = std::ranges::ref_view(svec[0]);
17 auto all = std::views::all(svec);
18 auto subset = all | std::views::take(2);
19 std::puts(s: "Break here");
20 }
21
22 {
23 Foo f[2];
24 auto view = std::ranges::ref_view(f);
25 std::puts(s: "Break here");
26 }
27}
28

source code of lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/main.cpp