Cannot make my shared PureMallocator callable in pure functions
Steven Schveighoffer
schveiguy at yahoo.com
Sat Feb 17 19:35:24 UTC 2018
On 2/17/18 9:54 AM, ag0aep6g wrote:
> On 02/17/2018 03:04 PM, Steven Schveighoffer wrote:
>> You have to be a bit careful here. pure functions can assume nothing
>> is happening and simply not call the function.
>
> That's only a problem when the called function is strongly pure, right?
>
> 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.
That's fine as long as you aren't going to use the allocator to make any
immutable or const data ;)
-Steve
More information about the Digitalmars-d-learn
mailing list