Re: Why not memory specific destructors?

2014-05-06 Thread HaraldZealot via Digitalmars-d
Destructors of the first kind are usually called just destructors and are used for resource management, and the second kind are called finalizers. These are useful for implementing weak references, caching, and various other things where you don't require objects to be destroyed at a certain p

Re: Why not memory specific destructors?

2014-05-06 Thread via Digitalmars-d
On Monday, 5 May 2014 at 18:08:22 UTC, Frustrated wrote: So, instead of removing destructors why not have multiple types? If the object is manually allocated then we can guarantee the destructor will be called when the object is free'ed. But basically, since they would be different types of

Why not memory specific destructors?

2014-05-05 Thread Frustrated via Digitalmars-d
I never got the real issue with destructors(I haven't seen the issue explained, just a lot of talk about it being a problem and how to fix it) but I think doing away with them would be a very bad idea. Assuming the only/main issue is with the GC not guaranteeing to call them then that is really