I wish all qualifiers were revisited with an eye for simplification

Adam D. Ruppe destructionator at gmail.com
Sun Aug 2 21:30:28 UTC 2020


On Sunday, 2 August 2020 at 20:50:14 UTC, Andrei Alexandrescu 
wrote:
> The cabal convinces me that inout is actually great and that 
> I'm an idiot.

inout is great, but you are also not wrong about it. It has 
frustrating arbitrary limitations that should really just get 
lifted.

Steven designed it conservatively thinking it was a good idea at 
the time but agrees now it was a mistake to limit it like this.

Simplest step we could do is define inout == const if used for a 
local variable in a non-inout function. I think that'd eliminate 
the majority of the headache.

The `is` expression should be more strict, but a local 
declaration should just fallback to const for practicality.

> Believe it or not, the type "const inout shared T" exists. Of 
> course, nobody knows what it really means or how it could be 
> used.

I don't even have an idea lol


More information about the Digitalmars-d mailing list