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

Merged
merged 1 commit into from
Jun 17, 2025

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.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 17, 2025

@jbcoe: Any thoughts?

@jbcoe
Copy link

jbcoe commented Jun 17, 2025

owned object

"owned object" sounds correct.

@tkoeppe tkoeppe merged commit 9d20a32 into cplusplus:main Jun 17, 2025
2 checks passed
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.

4 participants