Explicit default constructor for structs
Andrej Mitrovic
andrej.mitrovich at gmail.com
Thu Apr 10 04:38:59 PDT 2014
On 4/9/14, Brian Schott <briancschott at gmail.com> wrote:
> Really? What does this program print using a current version of
> DMD?
>
> import std.stdio;
>
> struct SomeStruct
> {
> this(int i = 10)
> {
> this.i = i;
> }
> int i;
> }
>
> void main(string[] args)
> {
> auto s = SomeStruct();
> writeln("s.i = ", s.i);
> }
This is a current bug that is going to be fixed:
https://github.com/D-Programming-Language/dmd/pull/1397
More information about the Digitalmars-d
mailing list