On 09/02/2021 5:05, frame wrote:
On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote:
Why using 'new' is allowed in pure functions but calling GC.addRange or GC.removeRange isn't allowed?

Does 'new' violate the 'pure' paradigm? Pure functions can only call pure functions and GC.addRange or GC.removeRange is only 'nothrow @nogc'.

new allocates memory via the GC and the GC knows to scan this location. Seems like implicit GC.addRange.

Reply via email to