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?
"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."
- Re: DIP44: scope(class) and scope(struct) Simen Kjaeraas
- Re: DIP44: scope(class) and scope(str... Joseph Rushton Wakeling
- Re: DIP44: scope(class) and scope(struct) Andrej Mitrovic
- Re: DIP44: scope(class) and scope(struct) H. S. Teoh
- Re: DIP44: scope(class) and scope(struct) Andrej Mitrovic
- Re: DIP44: scope(class) and scope(struct) H. S. Teoh
- Re: DIP44: scope(class) and scope(struct) Ramon
- Re: DIP44: scope(class) and scope(str... Simen Kjaeraas
- Re: DIP44: scope(class) and scope(str... Ramon
- Re: DIP44: scope(class) and scope(struct) Meta
- Re: DIP44: scope(class) and scope(struct) H. S. Teoh
- Re: DIP44: scope(class) and scope(struct) Piotr Szturmaj
- Re: DIP44: scope(class) and scope(struct) Artur Skawina
- Re: DIP44: scope(class) and scope(struct) H. S. Teoh
- Re: DIP44: scope(class) and scope(str... H. S. Teoh
- Re: DIP44: scope(class) and scope(str... Artur Skawina
- Re: DIP44: scope(class) and scope(struct) deadalnix
- Re: DIP44: scope(class) and scope(struct) Tobias Pankrath
- Re: DIP44: scope(class) and scope(struct) Dmitry Olshansky
- Re: DIP44: scope(class) and scope(struct) Andrei Alexandrescu
