[Issue 4621] Destructors are inherently un- at safe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 11 13:20:45 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4621



--- Comment #6 from Michel Fortin <michel.fortin at michelf.com> 2010-08-11 16:20:44 EDT ---
It could be an attribute, or it could be something else.

For instance, instead of having just destructors, we could have destructors
(~this) and finalizers (~~this). A struct with neither can go anywhere, a
struct with a destructor but no finalizer cannot go on the GC-heap,  a struct
with only a finalizer can go anywhere (the finalizer is used as the
destructor), and a struct with both can go anywhere. The finalizer cannot be
made @safe.

Doing this with structs would probably mean allowing only finalizers (~~this)
for classes, which according to my syntax suggestion would break existing code
for class destructors. Perhaps the syntax should be different.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list