@disable this for structs

Namespace rswhite4 at googlemail.com
Thu Feb 27 10:13:41 PST 2014


On Thursday, 27 February 2014 at 18:10:38 UTC, Steve Teale wrote:
> Could someone please explain what you would use this for to an 
> old man rooted in C++, but who loves D.
>
> Where does it fit in relative to 42?
>
> ;=(
>
> Steve

It's for explicit initialization:

struct Foo { }

Foo f; // no problem

struct Bar {
     @disable this();
}

Bar b; // error



More information about the Digitalmars-d-learn mailing list