Challenge: write a reference counted slice that works as much as possible like a built-in slice
Elronnd
elronnd at elronnd.net
Mon Nov 8 23:17:28 UTC 2021
On Monday, 8 November 2021 at 21:42:12 UTC, Andrei Alexandrescu
wrote:
> 1. We could not make reference counting work properly in pure
> functions (a pure function does not mutate data, which goes
> against manipulating the reference count).
pure functions can mutate data passed to them. And for a struct
method (such as a copy constructor) this includes the struct's
fields.
More information about the Digitalmars-d
mailing list