Cannot make my shared PureMallocator callable in pure functions

Nordlöw per.nordlow at gmail.com
Sat Feb 17 22:30:27 UTC 2018


On Saturday, 17 February 2018 at 14:54:37 UTC, ag0aep6g wrote:
> Nordlöw's methods are only weakly pure. They have mutable 
> indirections either in the return type or in a parameter type. 
> So calls to them should not be optimized away.

I found a solution at

https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d

currently successfully used at

https://github.com/nordlow/phobos-next/blob/master/src/open_hashmap_or_hashset.d

Works for me.

Thanks!


More information about the Digitalmars-d-learn mailing list