Skip to content

Commit

Permalink
Remove extraneous 'noexcept' on string_view::contains(char *) (#5069)
Browse files Browse the repository at this point in the history
* Remove extraneous 'noexcept' on string_view::contains(char *)

* Remove 'noexcept' from string::contains(char *) as well
  • Loading branch information
Marshall Clow authored and GitHub Enterprise committed Nov 1, 2024
1 parent af64533 commit a542ae5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions groups/bsl/bslstl/bslstl_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -2901,8 +2901,7 @@ class basic_string

/// Return `true` if this view contains with the specified
/// `characterString`, and `false` otherwise.
bool contains(const CHAR_TYPE* characterString)
const BSLS_KEYWORD_NOEXCEPT;
bool contains(const CHAR_TYPE* characterString) const;

/// Return `true` if the length of this string is equal to or greater
/// than the length of the specified `characterString` and the first
Expand Down Expand Up @@ -7161,7 +7160,7 @@ bool basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::contains(
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
BSLS_PLATFORM_AGGRESSIVE_INLINE
bool basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::contains(
const CHAR_TYPE* characterString) const BSLS_KEYWORD_NOEXCEPT
const CHAR_TYPE* characterString) const
{
BSLS_ASSERT_SAFE(characterString);
return npos != find(characterString);
Expand Down
5 changes: 2 additions & 3 deletions groups/bsl/bslstl/bslstl_stringview.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,7 @@ class basic_string_view {
/// Return `true` if this view contains with the specified
/// `characterString`, and `false` otherwise.
BSLS_KEYWORD_CONSTEXPR_CPP17
bool contains(const CHAR_TYPE* characterString)
const BSLS_KEYWORD_NOEXCEPT;
bool contains(const CHAR_TYPE* characterString) const;

/// Return `true` if this view starts with the specified `subview`, and
/// `false` otherwise. See {Lexicographical Comparisons}.
Expand Down Expand Up @@ -1943,7 +1942,7 @@ template <class CHAR_TYPE, class CHAR_TRAITS>
BSLS_PLATFORM_AGGRESSIVE_INLINE
BSLS_KEYWORD_CONSTEXPR_CPP17
bool basic_string_view<CHAR_TYPE, CHAR_TRAITS>::contains(
const CHAR_TYPE* characterString) const BSLS_KEYWORD_NOEXCEPT
const CHAR_TYPE* characterString) const
{
BSLS_ASSERT_SAFE(characterString);
return npos != find(characterString);
Expand Down

0 comments on commit a542ae5

Please sign in to comment.