On 2011-05-13 09:44:33 -0400, Don <[email protected]> said:

If the GC calls it, it's a finalizer, not a destructor.

Structs have destructors, and it's perfectly OK to throw inside them.

Really? What if you allocated the struct on the heap, as a member of a class, or in an array? The struct will be on the heap and its destructor will become the finalizer.

What you say about structs makes sense only as long as structs are confined to the stack. In reality, structs can also be on the heap.

Discussion for bug 4621's has a long discussion about this issue.
<http://d.puremagic.com/issues/show_bug.cgi?id=4621>

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to