]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Implement string_view range constructor for C++20
authorJonathan Wakely <jwakely@redhat.com>
Mon, 22 Mar 2021 17:11:21 +0000 (17:11 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 22 Mar 2021 22:56:04 +0000 (22:56 +0000)
commit7c1006135ddeab216f376adc5f6135a22bfc0ff6
tree4db966543587859bdee3a508649bf67510e93dea
parent2bfd081f1bce3fb7f791591e741723dce4e884ed
libstdc++: Implement string_view range constructor for C++20

This implements the new string_view constructor proposed by P1989R2.
This hasn't been voted into the C++23 draft yet, but it's been reviewed
by LWG and is expected to be approved at the next WG21 meeting.

libstdc++-v3/ChangeLog:

* include/std/string_view (basic_string_view(Range&&)): Define new
constructor and deduction guide.
* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: New test.
* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc: New test.
libstdc++-v3/include/std/string_view
libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc [new file with mode: 0644]