Skip to content

[indirect.asgn] std::indirect does not have a “contained value” #7822

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

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

Conversation

xmcgcg
Copy link
Contributor

@xmcgcg xmcgcg commented Apr 11, 2025

[indirect.asgn] p4 says:

If an exception is thrown during the call to T’s copy assignment, the state of its contained value is as defined by the exception safety guarantee of T’s copy assignment.

The wording is copied from the description of the copy assignment operator of std::optional, which has a contained value (defined in [optional.optional.general] p1). For std::indirect, there is no “contained value”, “owned object” should be used instead.

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.

1 participant