Explicit default constructor for structs

Jacob Carlborg doob at me.com
Wed Apr 9 10:07:13 PDT 2014


On 2014-04-09 18:59, Brian Schott wrote:
> What would this do?
>
> struct SomeStruct
> {
>      this(int i = 10)
>      {
>          this.i = i;
>      }
>
>      this(void)
>      {
>          this.i = 20;
>      }
>
>      int i;
> }
>
> auto s = SomeStruct();

Result in an ambiguity error?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list