val.init

Sean Kelly sean at invisibleduck.org
Wed Oct 2 10:54:13 PDT 2013


On Oct 1, 2013, at 7:10 PM, Nick Sabalausky <SeeWebsiteToContactMe at semitwist.com> wrote:

> I thought variable.init was different from T.init and gave the value of
> the explicit initializer if one was used. Was I mistaken?:
> 
> import std.stdio;
> void main()
> {
> 	int a = 5;
> 	writeln(a.init); // Outputs 0, not 5
> }

I think it used to work roughly this way but was changed… um… maybe 2 years ago?



More information about the Digitalmars-d-learn mailing list