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

FeepingCreature feepingcreature at gmail.com
Tue Jun 23 14:42:44 UTC 2020


On Monday, 22 June 2020 at 15:34:36 UTC, Seb wrote:
> 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

Yes, effectively what I'm looking for is "Rebindable for 
immutable structs." I already have this in Nullable, but it's an 
atrocious hack because I basically have to hit the compiler on 
the head until it forgets what const is. I want some way to say 
"yes, this type is immutable, but it's only immutable over its 
lifetime, and *I* control its lifetime and *I* say when it ends - 
and when it ends, I'm free to put other data there, such as the 
return value of rest()."

This is also vital for finally allowing immutable types in 
(key-)mutable hashmaps.


More information about the Digitalmars-d mailing list