LWG-4245 Operators that interact with counted_iterator and default_sentinel_t should be noexcept
Per WG21-P3742R0 (alternative link), LWG-4245 was resolved in the June 2025 meeting. LWG-4245 specifies operators between counted_iterator and default_sentinel_t to be noexcept, and MSVC STL has already added noexcept with /* strengthened */ comments.
As these occurrences of noexcept are to become mandatory, these /* strengthened */ comments should be removed.
|
_NODISCARD friend constexpr iter_difference_t<_Iter> operator-(
|
|
const counted_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ {
|
|
return -_Left._Length;
|
|
}
|
|
_NODISCARD friend constexpr iter_difference_t<_Iter> operator-(
|
|
default_sentinel_t, const counted_iterator& _Right) noexcept /* strengthened */ {
|
|
return _Right._Length;
|
|
}
|
|
_NODISCARD friend constexpr bool operator==(const counted_iterator& _Left, default_sentinel_t) noexcept
|
|
/* strengthened */ {
|
|
return _Left._Length == 0;
|
|
}
|
This issue is intended for a new contributor (especially one new to GitHub) to get started with the simplest possible change.
Please feel free to submit a pull request if there isn't one already linked here - no need to ask for permission! 😸
You can (and should) link your pull request to this issue using GitHub's close/fix/resolve syntax.
(in the PR description not the commit message)
LWG-4245 Operators that interact with
counted_iteratoranddefault_sentinel_tshould benoexceptPer WG21-P3742R0 (alternative link), LWG-4245 was resolved in the June 2025 meeting. LWG-4245 specifies operators between
counted_iteratoranddefault_sentinel_tto benoexcept, and MSVC STL has already addednoexceptwith/* strengthened */comments.As these occurrences of
noexceptare to become mandatory, these/* strengthened */comments should be removed.STL/stl/inc/iterator
Lines 1314 to 1317 in 7841cf8
STL/stl/inc/iterator
Lines 1319 to 1322 in 7841cf8
STL/stl/inc/iterator
Lines 1345 to 1348 in 7841cf8
This issue is intended for a new contributor (especially one new to GitHub) to get started with the simplest possible change.
Please feel free to submit a pull request if there isn't one already linked here - no need to ask for permission! 😸
You can (and should) link your pull request to this issue using GitHub's close/fix/resolve syntax.
(in the PR description not the commit message)