Skip to content

Remove comments for LWG-4245 Operators that interact with counted_iterator and default_sentinel_t should be noexcept #5582

@frederick-vs-ja

Description

@frederick-vs-ja

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.

STL/stl/inc/iterator

Lines 1314 to 1317 in 7841cf8

_NODISCARD friend constexpr iter_difference_t<_Iter> operator-(
const counted_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ {
return -_Left._Length;
}

STL/stl/inc/iterator

Lines 1319 to 1322 in 7841cf8

_NODISCARD friend constexpr iter_difference_t<_Iter> operator-(
default_sentinel_t, const counted_iterator& _Right) noexcept /* strengthened */ {
return _Right._Length;
}

STL/stl/inc/iterator

Lines 1345 to 1348 in 7841cf8

_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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    LWGLibrary Working Group issuefixedSomething works now, yay!

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions