DIP44: scope(class) and scope(struct)
Meta
jared771 at gmail.com
Fri Aug 23 21:19:25 PDT 2013
"With this extension to scope guards, class and struct
destructors will practically not be needed anymore, since
scope(this) will take care of cleaning up everything."
I can't think of an example off the top of my head, but is it
really okay to conflate destruction due to an error during
construction, and destruction over the regular course of a
struct's usage? What if one instance requires different code from
the other? Maybe require that scope(this) statements *only* be
run if there is an error during construction, while just the
destructor will be run normally?
More information about the Digitalmars-d
mailing list