std.v2020.algorithm etc[ WAS: Is run.d going to be expand for runtime and the phobos library?]

Seb seb at wilzba.ch
Mon Jun 22 15:34:36 UTC 2020


On Monday, 22 June 2020 at 15:29:25 UTC, Seb wrote:
> On Monday, 22 June 2020 at 12:28:06 UTC, FeepingCreature wrote:
>>
>> I think maybe what is needed is a notion of "head-mutable"?
>
> It's called Final and already in Phobos:
>
> https://dlang.org/phobos/std_experimental_typecons.html#.Final
>
> Though it comes with a few bugs like e.g. [1] or [2].
>
> [1] https://issues.dlang.org/show_bug.cgi?id=17272
> [2] https://github.com/dlang/phobos/pull/6596

Sorry. I read to quick. Final is head-const and tail-mutable.
Rebindable is the Phobos solution to head-mutable / tail-const:

https://dlang.org/phobos/std_typecons.html#Rebindable

The biggest gotcha of Rebindable is that it doesn't work with 
structs [1] which vastly limits its usability.

[1] https://github.com/dlang/phobos/pull/6136


More information about the Digitalmars-d mailing list