On 2011-05-13 13:16:03 -0400, Max Samukha <[email protected]> said:
On 05/13/2011 04:44 PM, Don wrote:
If the GC calls it, it's a finalizer, not a destructor.
Structs have destructors, and it's perfectly OK to throw inside them.
Destructor/finalizer confusion is one of D's weakest spots. GC and
"delete" (now - "clear") should have never been designed to call the
same function. Now that there are talks about making GC call
destructors on structs, structs are at the threat of becoming as broken
as classes are.
They're already broken in subtle and racy ways because of this. A few examples:
<http://d.puremagic.com/issues/show_bug.cgi?id=4624>
--
Michel Fortin
[email protected]
http://michelf.com/