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

[class.copy.ctor] p6 The implicitly declared function does declare the function #5452

Open
xmh0511 opened this issue May 6, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented May 6, 2022

[class.copy.ctor] p6 says

If the class definition declares a move constructor or move assignment operator, the implicitly declared copy constructor is defined as deleted; otherwise, it is defaulted ([dcl.fct.def]).

I wonder whether the implicitly declared move constructor is considered to declare that function?

struct A{
  /* A(A const&); implicitly declared copy constructor */

  // Cause the copy constructor to be defined as deleted?
  /* A(A&&); implicitly declared move constructor  */   
};

Anyway, "implicitly declare" is a kind of "declare", I think. Maybe, we could clarify the ambiguity with the following suggestion?

If the class definition has a user-declared move constructor or move assignment operator, the implicitly declared copy constructor is defined as deleted; otherwise, it is defaulted ([dcl.fct.def]).

[class.copy.assign] p2 has a similar issue.

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

No branches or pull requests

1 participant