Emplace vs closures

ag0aep6g via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 19 05:35:09 PDT 2016


On 09/19/2016 02:24 PM, Lodovico Giaretta wrote:
> Oh. I didn't thought about that. This means that in the following
> example, the initialization of `s` is more than a simple call to
> `S.init`. I was under the impression that in D `S.init` should represent
> a valid state for whatever type `S`.

Yeah, .init and nested structs don't really fit together. On the one 
hand .init is supposed to be a valid value. On the other hand it must be 
a static value. Can't have both with nested structs. Maybe they 
shouldn't have .init at all.


More information about the Digitalmars-d mailing list