-
Notifications
You must be signed in to change notification settings - Fork 774
[container.requirements] Simplify Returns specification for try_emplace #7892
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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..."
132931e
to
4c7ff44
Compare
source/containers.tex
Outdated
@@ -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.
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 must not have been paying attention either; my bad. The latest commit should resolve everything.
4c7ff44
to
a4e485e
Compare
Fixes #7881.