DIP44: scope(class) and scope(struct)
Tobias Pankrath
tobias at pankrath.net
Sat Aug 24 05:48:53 PDT 2013
On Saturday, 24 August 2013 at 00:45:46 UTC, H. S. Teoh wrote:
> I've written up a proposal to solve the partially-constructed
> object
> problem[*] in D in a very nice way by extending scope guards:
[snip]
What about a language rule, that for every type T destroy(t) must
be valid if t == T.init?
Couldn't this problem be solved by using RAII and destructors?
You would (only) need to make sure that every member is either
correctly initialised or T.init.
More information about the Digitalmars-d
mailing list