Skip to content

Conversation

@fiesh
Copy link
Contributor

@fiesh fiesh commented Mar 20, 2025

This change is Reviewable

This allows `gcc` to elide the copy in the return and keeps it from
warning with `-Wnvro` enabled.
The definition of the dtor is not necessary and actually harmful since
the definition of a class's implicit copy constructor is deprecated if
that class has a user-declared constructor as of C++11.  Compilers can
warn about this with `-Wdeprecated`.
@DrMicrobit
Copy link

I'd like to see e96358d being taken over into master if nothing speaks against it.

Reason: Apple clang 17 running with -std=c++20 -Werror -Wdeprecated will show this as error.

Taking only the destructor out while a constructor is still present is a warning sign regarding the rule of three, but looking at the constructor I think this is safe.

See also discussion regarding this in context of rule of three on https://stackoverflow.com/questions/51863588/warning-definition-of-implicit-copy-constructor-is-deprecated.

@jarro2783 jarro2783 merged commit 80cb452 into jarro2783:master Aug 6, 2025
7 of 10 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