Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stl/inc/xstring
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ template <class _Traits>
struct _Char_traits_eq {
using _Elem = typename _Traits::char_type;

bool operator()(_Elem _Left, _Elem _Right) const {
bool operator()(_Elem _Left, _Elem _Right) const noexcept {
return _Traits::eq(_Left, _Right);
}
};
Expand All @@ -560,7 +560,7 @@ template <class _Traits>
struct _Char_traits_lt {
using _Elem = typename _Traits::char_type;

bool operator()(_Elem _Left, _Elem _Right) const {
bool operator()(_Elem _Left, _Elem _Right) const noexcept {
return _Traits::lt(_Left, _Right);
}
};
Expand Down Expand Up @@ -698,7 +698,7 @@ constexpr size_t _Traits_rfind_ch(_In_reads_(_Hay_size) const _Traits_ptr_t<_Tra
template <class _Elem, bool = _Is_character<_Elem>::value>
class _String_bitmap { // _String_bitmap for character types
public:
constexpr bool _Mark(const _Elem* _First, const _Elem* const _Last) {
constexpr bool _Mark(const _Elem* _First, const _Elem* const _Last) noexcept {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, these four added noexcepts have nothing to do with LWG-3518 or character trait operations, I simply noticed in passing that they are do not emit exceptions when operating on character-like types.

// mark this bitmap such that the characters in [_First, _Last) are intended to match
// returns whether all inputs can be placed in the bitmap
for (; _First != _Last; ++_First) {
Expand All @@ -708,7 +708,7 @@ public:
return true;
}

constexpr bool _Match(const _Elem _Ch) const { // test if _Ch is in the bitmap
constexpr bool _Match(const _Elem _Ch) const noexcept { // test if _Ch is in the bitmap
return _Matches[static_cast<unsigned char>(_Ch)];
}

Expand All @@ -723,7 +723,7 @@ public:
"Standard char_traits is only provided for char, wchar_t, char16_t, and char32_t. See N5687 [char.traits]. "
"Visual C++ accepts other unsigned integral types as an extension.");

constexpr bool _Mark(const _Elem* _First, const _Elem* const _Last) {
constexpr bool _Mark(const _Elem* _First, const _Elem* const _Last) noexcept {
// mark this bitmap such that the characters in [_First, _Last) are intended to match
// returns whether all inputs can be placed in the bitmap
for (; _First != _Last; ++_First) {
Expand All @@ -738,7 +738,7 @@ public:
return true;
}

constexpr bool _Match(const _Elem _Ch) const { // test if _Ch is in the bitmap
constexpr bool _Match(const _Elem _Ch) const noexcept { // test if _Ch is in the bitmap
return _Ch < 256U && _Matches[_Ch];
}

Expand Down