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

[expected.object.general] Add missing noexcept for expected::error() #5381

Merged
merged 2 commits into from Apr 26, 2022

Conversation

hewillk
Copy link
Contributor

@hewillk hewillk commented Apr 1, 2022

In [expected.object.general], the function is defined as

constexpr const E& error() const &;

However in [expected.object.obs], it is defined as

constexpr const E& error() const & noexcept;

So let me assume it's just that the author of the paper forgot to add noexcept.

@jensmaurer
Copy link
Member

@jwakely, this looks like an oversight in the incoming paper. Do you think this is editorial, or does it need an LWG issue?

Note: squash and fix commit message when merging

@jensmaurer
Copy link
Member

@jwakely , ping.

@jwakely
Copy link
Member

jwakely commented Apr 26, 2022

I don't recall the intention or whether we discussed making these narrow contact functions noexcept. I'll check the minutes.

@jwakely
Copy link
Member

jwakely commented Apr 26, 2022

The noexcept on the detailed descriptions appeared in P0323R11 following the 2021-10-08 LWG review. The minutes show:

  • TS: there should be noexcept on the -> and * operators although they have a precondition
  • JW: we should get rid of the expected:: qualification on value()
  • JW: error() can be noexcept

It looks like we agreed to add it then, but it wasn't added to the synopsis. So I think this can be fixed editorially.

@jensmaurer jensmaurer merged commit 41bc0c2 into cplusplus:main Apr 26, 2022
@hewillk hewillk deleted the main3 branch May 6, 2022 13:03
StephanTLavavej added a commit to miscco/STL that referenced this pull request May 20, 2022
Thanks to cplusplus/draft#5381 ,
this shouldn't be marked as strengthened.
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