Explicit default constructor for structs

Benjamin Thaut code at benjamin-thaut.de
Wed Apr 9 11:50:58 PDT 2014


Am 09.04.2014 20:42, schrieb Walter Bright:
> On 4/9/2014 7:59 AM, Benjamin Thaut wrote:
>> What do you think? C&C welcome.
>
> Or you could use a factory function:
>
>    struct Foo {
>      static Foo factory() { ... }
>      ...
>    }
>
>    auto foo = Foo.factory();
>
>

But I don't want the construction  to be syntacically any different. I 
know there are workarounds, but after all they are workarounds.


More information about the Digitalmars-d mailing list