On Saturday, 6 February 2016 at 22:51:45 UTC, cy wrote:
auto e = somethingThatFails()
scope(failure) cleanup(e);

makes more sense to me, since it's blatantly obvious that the construction (and entering) process isn't covered by the cleanup routine.

Not sure what you mean by that. Destructors shall not be called if constructors fail, constructors should clean up themselves.

"scope(failure)" is useful for C-like APIs, but not a good replacement for RAII.

Reply via email to