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

[func.wrap.func.cons] [any.assign] Harmonize operator= wording #6746

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Quuxplusone
Copy link
Contributor

This harmonizes the wording of operator= semantics for all four type-erasure types (function, any, move_only_function, copyable_function) by bringing the former two into line with the latter (newer) two.

Using "Equivalent to" instead of "As if by" allows us to omit some wording about what exceptions might be thrown. [func.wrap.func.con] also had a typo "As if by x;" that should have been "As if by x."

The one borderline-editorial part is function's move-constructor ([func.wrap.func.cons]/21). The old wording is
"Replaces the target of *this with the target of f," which a sufficiently smart vendor could take as giving permission to use the contained object's assignment operator (if f's contained object is assignable to *this's contained object) and/or to destroy *this's contained object before copying f's contained object. My impression is that no vendor (ab)uses that permission today, but please correct me if I'm wrong.

This harmonizes the wording of `operator=` semantics for all four
type-erasure types (function, any, move_only_function, copyable_function).
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

1 participant