std.allocator ready for some abuse

Timon Gehr timon.gehr at gmx.ch
Fri Oct 25 15:15:03 PDT 2013


On 10/25/2013 08:50 PM, Michel Fortin wrote:
> On 2013-10-25 15:14:38 +0000, "Adam D. Ruppe"
> <destructionator at gmail.com> said:
>
>> @safe void setAllocator(Allocator)(pure @safe void function() code) {}
>>
>> just might work out.
>
> I wonder what kind of things can be done in a pure function that takes
> no parameter and returns void. Not much I guess.
>

It can e.g. allocate data and embed it in an exception. (Which is also 
why the above function is still unsafe.)


More information about the Digitalmars-d mailing list