Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[range.adaptor.helpers] make as-lvalue noexcept #6197

Closed
wants to merge 1 commit into from

Conversation

hewillk
Copy link
Contributor

@hewillk hewillk commented Mar 20, 2023

Given that it's a sibling of std::as_const, would adding noexcept here conform to a more standard style even though it's exposition only?

Given that it's a sibling of std::as_const, would adding noexcept here conform to a more standard style even though it's exposition only?
@tkoeppe
Copy link
Contributor

tkoeppe commented May 12, 2023

@CaseyCarter Could you have a look please?

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 10, 2023

@jwakely: is this editorial?

@jwakely
Copy link
Member

jwakely commented Nov 10, 2023

Yes, it seems editorial, but completely unnecessary.

There are only a few uses of as-lvalue and none of them are in noexcept functions, and none of them depend on whether that cast can throw, and users can't observe whether or not it's noexcept. I see no reason to clutter an exposition-only function with keywords that have no effect.

Adding noexcept to as-const-pointer in [range.prim.cdata] seems like it might be more useful, since we use that directly in an "expression equivalent" context that users could actually test with the noexcept operator. As currently specified you could argue that ranges::cdata is forbidden from being noexcept because it has to be equivalent to a call to that exposition-only function which is not noexcept. But implementations are always free to strengthen noexcept anyway, so I assume the same holds for exposition-only functions.

@hewillk hewillk closed this Nov 10, 2023
@hewillk hewillk deleted the main-as-lvalue branch November 10, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants