pure and custom new / delete

Timon Gehr timon.gehr at gmx.ch
Tue Jun 26 09:02:22 PDT 2012


On 06/26/2012 05:59 PM, Benjamin Thaut wrote:
> As delete and new / delete overloading is deprecated and it was
> recommeneded to write tempaltes to repalce these expressions I did so.
>
> But now as everything starts to work out pretty nice I've walked into
> the 'purity' issue. Pure functions are only allowed to call other pure
> functions and as far as I know there is no way to make functions
> "trusted pure". But I would need to make certain functions "trused
> pure", espeically my new and delete replacements. Any suggestions how to
> do this?
>
> Kind Regards
> Benjamin Thaut

You can cast function pointers to pure, or mark extern(C) memory 
allocation functions as pure.


More information about the Digitalmars-d mailing list