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

[dcl.fct.def.delete] p1 Improve the phrase for "implicitly defined as deleted" #6378

Open
xmh0511 opened this issue Jul 15, 2023 · 5 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Jul 15, 2023

[dcl.fct.def.delete] p1 says:

A deleted function is a function with a deleted definition or a function that is implicitly defined as deleted.

Since in clauses [class], we say

A defaulted YYY for class X is defined as deleted if:

This includes explicitly-defaulted functions and implicitly-declared functions. A deleted definition function for the explicitly-defaulted function is defined as:

an explicitly-defaulted definition of the function where the function is defined as deleted.

So, it is an improvement to define the deleted function of the implicitly-declared function as the following:

an implicitly declared function that is defined as deleted.

@Eisenwave
Copy link
Contributor

You're right that his makes deleted definition and deleted function less redundant, but is this really a necessary change?

What does this improve? Is the current wording problematic in some way?

@jwakely
Copy link
Member

jwakely commented Aug 24, 2023

Yeah, I don't see a problem with the current wording. It doesn't really matter whether a given function is explicitly declared as defaulted and implicitly deleted, or explicitly declared as deleted, or implicitly declared and deleted, all of those are covered by [dcl.fct.def.delete] and are all deleted functions. If we need to distinguish between those cases elsewhere, we can do so. But for the purposes of defining the term "deleted function" it doesn't matter.

@xmh0511
Copy link
Contributor Author

xmh0511 commented Aug 24, 2023

How do you interpret the phrase implicitly defined as deleted, this term is not defined in the current wording.

@jwakely
Copy link
Member

jwakely commented Aug 24, 2023

One that is defined as deleted without you actually saying = delete. It doesn't actually matter whether that's because you say =default and the compiler defines it as deleted, or you don't declare it at all and the compile implicitly declares it and deletes it ... both cases are deleted functions anyway. So the definition of "deleted function" is ok.

@xmh0511
Copy link
Contributor Author

xmh0511 commented Aug 25, 2023

It doesn't actually matter whether that's because you say =default and the compiler defines it as deleted,

This is a function with a deleted definition, indeed, a deleted function

or you don't declare it at all and the compile implicitly declares it and deletes it ... both cases are deleted functions anyway.

This is the implicitly declared function that is defined as deleted, which is defined in clauses [class].

For the phrase a function that is implicitly defined as deleted, if there is no specific definition, it should refer to

  1. An explicitly-defaulted function that is defined as deleted
  2. An implicitly declared function that is defined as deleted

The first one is partially covered by

a function with a deleted definition

as per [dcl.fct.def.delete] p1.

It is an improvement if we define the deleted function as:

A deleted function is a function with a deleted definition or an implicitly declared function that is defined as deleted.

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

3 participants