Default struct constructors with pure

Jonathan M Davis jmdavisProg at gmx.com
Thu Oct 7 16:31:54 PDT 2010


This has probably been brought up before, but given that the lack of default 
constructors for structs was a major problem for the QtD folks, I've been 
thinking about the problem again, and I was wondering whether it would work to 
have default constructors for structs as long as they were pure? Isn't the main 
problem with having default constructors for structs that the default 
constructor must result in the same value every time so that the compiler can 
set init appropriately? Or is there something else to it? It does seem to me 
that we should get default constructors for structs to work if we can. It's 
obviously been causing a problem in real code, including for major projects like 
QtD.

- Jonathan M Davis


More information about the Digitalmars-d mailing list