scope(exit) considered harmful

Bill Baxter wbaxter at gmail.com
Sun Nov 8 11:13:40 PST 2009


On Sun, Nov 8, 2009 at 10:44 AM, Justin Johansson <no at spam.com> wrote:

> Can you understand my frustration?

Yes, I can certainly understand that it's difficult to use scope()
constructs when you haven't understood what a scope is.  But that's
not much of an argument against them.

The same rant you just wrote would apply equally to C++ RAII objects.
They won't work properly either if you haven't understood what this
means: "destructors are called upon exiting the scope in which
declared".

--bb



More information about the Digitalmars-d mailing list