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

[optional.optional] Remove qualified destructor calls, refactor postconditions of swap CWG1089 #6416

Closed
wants to merge 2 commits into from

Conversation

lprv
Copy link
Contributor

@lprv lprv commented Jul 25, 2023

val->T::~T() should be val->~T() (the former breaks if T has a member named T), but considering that 'destroys the contained value' is already sufficiently clear in its meaning, I don't see why explicitly specifying the syntax for a (pseudo-)destructor call is necessary at all.

This PR also changes the presentation of postconditions in [optional.swap] by moving them out of the 'Effects' table.

@jwakely
Copy link
Member

jwakely commented Nov 10, 2023

val->T::~T() should be val->~T() (the former breaks if T has a member named T),

Hmm, GCC and Clang compile that OK, EDG and MSVC don't.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 10, 2023

Thanks! I'm not sure if this PR is really an improvement. Even moving the postconditions out just creates the combinatorial complexity elsewhere that the table was meant to express concisely.

Please reopen if you feel strongly, but I'd say let's just leave this.

@tkoeppe tkoeppe closed this Nov 10, 2023
@jwakely
Copy link
Member

jwakely commented Nov 10, 2023

Hmm, GCC and Clang compile that OK, EDG and MSVC don't.

This is CWG 1089.

@jensmaurer jensmaurer changed the title [optional.optional] Remove qualified destructor calls, refactor postconditions of swap [optional.optional] Remove qualified destructor calls, refactor postconditions of swap CWG1089 Nov 11, 2023
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

4 participants