libstdc++: Add string contains member functions for C++2b
authorPaul Fee <paul.f.fee@gmail.com>
Wed, 27 Jan 2021 12:11:28 +0000 (12:11 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 27 Jan 2021 12:37:36 +0000 (12:37 +0000)
commitf004d6d9fab9fe732b94f0e7d254700795a37f30
tree4beb5e00be841b27653c7fe97e4d8e02ac43c3e3
parent4225af228b5d52e8d7593dea49584c91b4bc2e1f
libstdc++: Add string contains member functions for C++2b

This implements WG21 P1679R3, adding contains member functions to
basic_string_view and basic_string.

libstdc++-v3/ChangeLog:

* include/bits/basic_string.h (basic_string::contains): New
member functions.
* include/std/string_view (basic_string_view::contains):
Likewise.
* include/std/version (__cpp_lib_string_contains): Define.
* testsuite/21_strings/basic_string/operations/starts_with/char/1.cc:
Remove trailing whitespace.
* testsuite/21_strings/basic_string/operations/starts_with/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/contains/char/1.cc: New test.
* testsuite/21_strings/basic_string/operations/contains/wchar_t/1.cc: New test.
* testsuite/21_strings/basic_string_view/operations/contains/char/1.cc: New test.
* testsuite/21_strings/basic_string_view/operations/contains/char/2.cc: New test.
* testsuite/21_strings/basic_string_view/operations/contains/wchar_t/1.cc: New test.
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/std/string_view
libstdc++-v3/include/std/version
libstdc++-v3/testsuite/21_strings/basic_string/operations/contains/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string/operations/contains/wchar_t/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string/operations/starts_with/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string/operations/starts_with/wchar_t/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/contains/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/contains/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/contains/wchar_t/1.cc [new file with mode: 0644]