std.allocator ready for some abuse

Marco Leise Marco.Leise at gmx.de
Fri Oct 25 00:49:43 PDT 2013


Am Fri, 25 Oct 2013 00:33:40 +0200
schrieb "Namespace" <rswhite4 at googlemail.com>:

> Another idea would be that every built-in array has a Allocator 
> property which can be set:
> ----
> int[] arr;
> arr.allocator = Mallocator;
> ----

The type of arr.allocator would have to be CAllocator to allow
runtime swapping of allocators with polymorphism.

Would you'd implement it like .capacity, as a virtual property
that doesn't take up space in the slice?

-- 
Marco



More information about the Digitalmars-d mailing list