File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
reference/ranges/split_view Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ constexpr V base() &&; // (2) C++20
2727
2828``` cpp example
2929#include < ranges>
30- #include < string_view >
30+ #include < string >
3131#include < iostream>
3232
3333int main () {
3434 using std::ranges::view;
3535 using namespace std::literals;
3636
37- std::string_view text = "hello,world,split";
38- std::string_view delimiter = ",";
37+ std::string text = "hello,world,split";
38+ std::string delimiter = ",";
3939
4040 std::ranges::split_view r{text, delimiter};
4141
@@ -46,9 +46,9 @@ int main() {
4646 view auto b2 = std::move(r).base();
4747
4848 // 得られるのは元のRangeではなく、あくまでview
49- static_assert (not std::same_as<decltype(b1), std::string_view >);
50- static_assert ( std::same_as<decltype(b1), std::ranges::ref_view< std::string_view > >);
51- static_assert ( std::same_as<decltype(b2), std::ranges::ref_view< std::string_view > >);
49+ static_assert (not std::same_as<decltype(b1), std::string >);
50+ static_assert ( std::same_as<decltype(b1), std::ranges::ref_view< std::string > >);
51+ static_assert ( std::same_as<decltype(b2), std::ranges::ref_view< std::string > >);
5252}
5353```
5454* base[ color ff0000]
You can’t perform that action at this time.
0 commit comments