New library: rebindable, create a type that can stand in for any other type, but mutable (and without destructor)

FeepingCreature feepingcreature at gmail.com
Wed Sep 29 10:51:26 UTC 2021


On Wednesday, 29 September 2021 at 10:22:40 UTC, FeepingCreature 
wrote:
> Or: Turducken 2.0 The Reckoning
>
> https://code.dlang.org/packages/rebindable 
> https://github.com/FeepingCreature/rebindable
>
> Rebindable offers a proxy type, `rebindable.DeepUnqual` 
> (`DeepUnqual!T`) that can "stand in" for `T` in layout, but 
> does not share `T`'s constructor, destructor, copy constructor, 
> invariants or constness.
>

I forgot to mention: It does this by recursively crawling the 
member types of `T`, replacing all primitives with non-const 
equivalents.

Is this terrible? Yes, it's very terrible. I also don't see how 
to avoid it.


More information about the Digitalmars-d-announce mailing list