331
D / Re: Destroy destructor crashes?
« on: December 17, 2012, 11:17:15 pm »Others use structs or scoped objects (part of the language in D1, a Phobos template in D2) when possible to cleanup when an object goes out of scope. Personally, I just pretend the destructors don't even exist.
A scoped object wouldn't be a part of the GC, would it? This sounds more like a RAII technique to me. And like Nekroze was wondering, they would be allocated on the stack instead of the heap, correct? That said, if we were to use the sfXXX objects directly, they would be allocated on the stack anyways so using a struct or scoped object doesn't sound like the worst thing to do even if they are long-lived.