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

[stacktrace.entry.cmp] does not describe operator<=> #4801

Closed
mumbleskates opened this issue Aug 11, 2021 · 2 comments
Closed

[stacktrace.entry.cmp] does not describe operator<=> #4801

mumbleskates opened this issue Aug 11, 2021 · 2 comments

Comments

@mumbleskates
Copy link

In brief, the line

friend constexpr strong_ordering operator<=>(const stacktrace_entry& x,
                                             const stacktrace_entry& y) noexcept;

in [stacktrace.entry.overview] is not mentioned in the detailed specification in [stacktrace.empty.cmp], section 20.21.3.5.

@jwakely
Copy link
Member

jwakely commented Aug 11, 2021

[stacktrace.entry.overview] says it models three_way_comparable<strong_ordering> which is all we need to say. The actual ordering is unspecified, so there's nothing more to say.

@mumbleskates
Copy link
Author

This is true! I just put together an implementation status listing for libc++ and went over every operator<=> in the spec; out of about 51 distinct standard library types which have or may have operator<=>, and it does stand out a bit that this is the only type with nothing to say; I suppose it's fine though, as pretty much all the rest have sensible commonly observable properties or derive their ordering from the value types.

It wasn't immediately obvious to me that modeling three_way_comparable<strong_ordering> is enough to actually guarantee reasonable behavior but this sounds fine, thanks for the reply

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

No branches or pull requests

2 participants