const AA require

Tejas notrealemail at gmail.com
Wed Aug 4 08:08:35 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?

Casting ```const``` away is undefined behaviour in D. And what is 
this "require"? Maybe show more code?


More information about the Digitalmars-d mailing list