On 2/6/14, 12:51 PM, Frustrated wrote:
On Thursday, 6 February 2014 at 20:24:55 UTC, Andrei Alexandrescu
wrote:
On 2/6/14, 12:01 PM, Frustrated wrote:
See the other post about this. scopeDeallocation meant to simply
signal that the scope of a has ended but not necessarily there
are no references to a.

So that's a struct destructor.

Andrei

Well, except it hooks into the memory allocation strategy.

I'm not saying that what I outlined above is perfect or the way
to go but just an idea ;)

If new had some way to pass an "interface" that contained the
allocation strategy details and one had the notation like

new!MyManualAllocator A;

then I suppose A's destructor could call MyManualAllocator's
"scopeDeallocator" method and you wouldn't need an implicit call
there.

What is MyManualAllocator - type or value?

I should emphasize that obsessing over the syntax is counterproductive. Call a blessed function and call it a day.


Andrei

Reply via email to