dlang.org icon indicating copy to clipboard operation
dlang.org copied to clipboard

The spec should not refer to default initialization as default construction when discussing disabling it

Open dlangBugzillaToGithub opened this issue 1 year ago • 4 comments

Jonathan M Davis (@jmdavis) reported this on 2024-10-11T18:32:54Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24805

CC List

  • Nick Treleaven (@ntrel)

Description

The language allows us to disable default initialization - e.g.

---
struct S
{
    int x;

    @disable this();

    this(int v) { x = v; }
}
---

and the https://dlang.org/spec/struct.html#disable_default_construction section of the spec discusses this. However, it incorrectly talks about disabling default construction instead of discussing disabling default initialization. As default construction is not a thing with structs in D in the first place, the terminology used in this part of the spec is just plain wrong and risks confusing people. The spec should be updated to talk about disabling default initialization instead.

dlangBugzillaToGithub avatar Oct 11 '24 18:10 dlangBugzillaToGithub