const AA require

Mathias LANG geod24 at gmail.com
Wed Aug 4 15:57:23 UTC 2021


On Thursday, 29 July 2021 at 20:44:35 UTC, Elronnd wrote:
> const(int)[int] d;
> d.require(5, 7); //compile error
>
> From a semantics perspective, though, I don't think there's 
> anything wrong with this, and 'require' could reasonably cast 
> the const away before assigning.  Am I missing anything?

You aren't missing anything. It's a bug, and should be fixed, but 
that'll require making the frontend understand what `require` is 
(or providing a way to express this in a generic manner).


More information about the Digitalmars-d mailing list