how to disable all default N-argument constructors for a struct?

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 3 17:46:36 PDT 2017


How would I disable the following?

```
auto a1=A(1);
auto a2=A(1, "b");

struct A{
  int a;
  string b;
  // @disable default constructors with N(N>=1) arguments
}
```

I'd like to force the user to set fields explicitly, so as to make it
more safe to add / move fields


More information about the Digitalmars-d mailing list