Challenge: write a reference counted slice that works as much as possible like a built-in slice
deadalnix
deadalnix at gmail.com
Tue Nov 9 01:04:34 UTC 2021
On Monday, 8 November 2021 at 22:40:03 UTC, Andrei Alexandrescu
wrote:
> On 2021-11-08 17:26, rikki cattermole wrote:
>> a reference counted struct should never be const
>
> So then we're toast. If that's the case we're looking at the
> most important challenge to the D language right now.
Not necessarily, but this is in fact the same problem as the head
mutable problem.
If `const RCSlice!(const T)` can convert to `RCSlice!(const T)`,
which it should to have the same semantic as slice.
The reference counting problem goes away if you can mutate the
head.
More information about the Digitalmars-d
mailing list