Temporaries / struct RAII patterns

Witold witold.baryluk+dlang at gmail.com
Mon Oct 16 00:14:42 UTC 2023


Also I added

```d
        // Disables default construction
        @disable this();
        // Disable copy constructor
        @disable this(ref X);

```

to `struct X`,

and that triggers an error, because compiler is trying to call a 
copy constructor when doing return from `Foo`.



More information about the Digitalmars-d mailing list