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

[system_error.syn] [syserr.compare] Declare all nonmembers in the synopsis #881

Merged
merged 1 commit into from Nov 18, 2016

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Aug 4, 2016

Move definitions of less-than operators to [syserr.compare]

Fixes #880

@@ -1192,7 +1201,6 @@

// \ref{syserr.errcode.nonmembers} non-member functions:
error_code make_error_code(errc e) noexcept;
bool operator<(const error_code& lhs, const error_code& rhs) noexcept;

template <class charT, class traits>
basic_ostream<charT, traits>&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to delete this one when adding the one above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure I did mean to, because I moved it to line 894.

We could have it in both places (as we do for make_error_code and operator<<), but if we do that then we should also have operator== and the other overloads in both places. IMHO it makes no sense for only operator< to be in the class synopsis.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I wasn't very clear. The "this one" I'm referring to is the operator<< whose first line is highlighted here (github doesn't allow adding comments outside the diff context, annoyingly). I think that should be deleted, because you added it to the synopsis, but it hasn't been.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I'll do that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think I did it that way because make_error_code(errc e) is also in both places, and operator<< is grouped with that (both before and after my change) in [syserr.errcode.nonmembers], but operator<< was missing from the header synopsis, and after my change is not in [syserr.errcondition.nonmembers].

If I remove operator<< from the class synopsis I should also remove make_error_code(errc). I think I prefer not to remove either.

I moved the relational operators to be alongside the equality operators, which are only in the header synopsis not the class synopses. That's because the equality ops are in [syserr.compare] which is at the same level as error_code and error_condition, rather than being a "non-member functions" subclause.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that everything should be in the header synopsis, otherwise that synopsis is incomplete. Whether some non-members are also duplicated in the class synopses is less important, but I made the call based on whether they are defined in a subclause of the class, or in a sibling clause.

\returns
\begin{codeblock}
lhs.category() < rhs.category() ||
(lhs.category() == rhs.category() && lhs.value() < rhs.value()).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to fix this weird non-code period in code font.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to a semi-colon.

…opsis

Move definitions of less-than operators to [syserr.compare]

Fixes cplusplus#880
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