IAllocator

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 4 06:50:05 PST 2016


On 01/03/2016 11:50 PM, Rikki Cattermole wrote:
> On 04/01/16 11:44 AM, Andrei Alexandrescu wrote:
>> https://issues.dlang.org/show_bug.cgi?id=15509 is up. Any takers? --
>> Andrei
>
> Now I'm worried, this will break a lot of my code.

May break if you use the IAllocator type explicitly a lot; you need to 
change that name.

> I'm just not convinced that RefCounted is the correct tool for this job.

It may not because it gives access to the underlying interface, which 
I'd rather keep encapsulated. I think a hand-defined proxy struct around 
the IAllocator type is the ticket.

> It changes the allocator type. IAllocator is an interface for a reason.
> It allows swapping things out without worrying about implementation and
> using templates.

That won't go away. I guess I need to write the code to fully explain 
what's needed.


Andrei


More information about the Digitalmars-d mailing list