Explicit default constructor for structs

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


Am 09.04.2014 18:59, schrieb Brian Schott:
> What would this do?
>
> struct SomeStruct
> {
>      this(int i = 10)
>      {
>          this.i = i;
>      }
>
>      this(void)
>      {
>          this.i = 20;
>      }
>
>      int i;
> }
>
> auto s = SomeStruct();

Thats easy to answer. What would it do if you replace the "struct" with 
"class" and the "void" with nothing?


More information about the Digitalmars-d mailing list