Skip to content

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

Merged
jensmaurer merged 2 commits intocplusplus:mainfrom
hewillk:main3
Apr 26, 2022
Merged

[expected.object.general] Add missing noexcept for expected::error()#5381
jensmaurer merged 2 commits intocplusplus:mainfrom
hewillk:main3

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.

3 participants