[Dlang-internal] Const or invariant key in dynamic array
Valentino Giudice
valentino.giudice96 at gmail.com
Mon Aug 24 02:55:16 UTC 2026
On Monday, 24 August 2026 at 02:11:24 UTC, Richard (Rikki) Andrew
Cattermole wrote:
> Associative array, not a dynamic array.
You are right, of course.
I know the terminology, yet I repeated the mistake several times,
including in the title.
My apologies.
> So basically to clarify:
>
> As long as a struct is by-value, is POD, allow mutable,
> otherwise require immutable.
Currently to avoid the wording it is required that the index is
mutable, if it is in the type.
What I am suggesting is that if the key is a simple value or a
POD, then I should be able to use a constant or immutable key
value without getting a warning, as I don't see how it can lead
to any issue.
More information about the Dlang-internal
mailing list