[libc++] Add noexcept to string::find and similar members.
Adds `noexcept` to `string_view`/`string::find` and similar members (`rfind`, etc.). See discussion in D95251. Refs D95821. Reviewed By: curdeius, ldionne Differential Revision: https://reviews.llvm.org/D95848
This commit is contained in:
@@ -29,6 +29,7 @@ template <class S>
|
||||
void
|
||||
test(const S& s, const typename S::value_type* str, int x)
|
||||
{
|
||||
LIBCPP_ASSERT_NOEXCEPT(s.compare(str));
|
||||
assert(sign(s.compare(str)) == sign(x));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ template <class S>
|
||||
void
|
||||
test(const S& s, const S& str, int x)
|
||||
{
|
||||
LIBCPP_ASSERT_NOEXCEPT(s.compare(str));
|
||||
assert(sign(s.compare(str)) == sign(x));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ template <class S, class SV>
|
||||
void
|
||||
test(const S& s, SV sv, int x)
|
||||
{
|
||||
LIBCPP_ASSERT_NOEXCEPT(s.compare(sv));
|
||||
assert(sign(s.compare(sv)) == sign(x));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user