-
Notifications
You must be signed in to change notification settings - Fork 772
[container.requirements] Simplify Returns specification for try_emplace #7892
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
base: main
Are you sure you want to change the base?
Conversation
@jwakely , since we already say we do as-if |
Why not just Equivalent to: Returns ... except that ... ? |
cb056ae
to
806be71
Compare
@jwakely that seems better, yes. I've also deleted a bunch of the adjacent specifications because those are inherited when "Equivalent to" is specified. Let me know if that's correct. |
806be71
to
132931e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the \result
elements should remain, those are still useful (and [structure.specifications] p4 does not say that Effects: Equivalent to implies the Result: element).
I prefer the original form of "is a hint ... Implementations are permitted to ignore the hint." rather than "is an ignorable hint..."
…ions for try_emplace
132931e
to
4c7ff44
Compare
with the key equivalent to the newly inserted element. | ||
The \tcode{const_iterator} \tcode{p} is a hint | ||
Equivalent to: \tcode{return a.emplace(std::forward<Args>(args)...).first}, | ||
expect that the \tcode{const_iterator} \tcode{p} is a hint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect that the \tcode{const_iterator} \tcode{p} is a hint | |
except that the \tcode{const_iterator} \tcode{p} is a hint |
@@ -3233,15 +3233,10 @@ | |||
|
|||
\pnum | |||
\effects | |||
Equivalent to \tcode{a.emplace(std::forward<Args>(args)...)}, | |||
Equivalent to: \tcode{return a.emplace(std::forward<Args>(args)...).first}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just realised that this doesn't work, because a_uniq.emplace
and a_eq.emplace
return different things. It's not a pair for a_eq
, so you can't do .first
So maybe what you had before was better, sorry.
Fixes #7881.