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.unexpected] Rearrange std::unexpected #5360

Merged
merged 2 commits into from Apr 22, 2022

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Mar 24, 2022

Some minor improvements to the std::unexpected spec.

This is the TOC before:

before

And after:

after

In the second image every "Class template foo" under 22.8 is at the same level, without the pointless "Unexpected objects" subclause, and without two "General" subclauses for one simple class template.

The other commit just reorders the std::unexpected synopsis to match the order of the detailed descriptions, and the order of corresponding constructors in the std::expected and std::expected<cv void, E> synopses and details descriptions.

This matches the order in [expected.un.ctor].
All the other class templates in <expected> are at the rSec3 level, but
std::unexpected is below a mostly useless rSec3 [expected.unexpected].
This subclause has two children, [expected.un.general] which is a single
sentence, and [expected.un.object] which defines the class template and
its members. If we merge the single sentence from [expected.un.general]
into the same subclause as the class synopsis then we can get remove the
unnecessary nesting. As a nice side effect, this also gets rid of
"object" in the [expected.un.object] stable name, which doesn't really
make sense in context.
@jensmaurer
Copy link
Member

@tkoeppe, this looks like an improvement. Do you want to merge that, or should I?

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