[Issue 17526] Add a set method for AA

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 5 17:00:33 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17526

hsteoh at quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh at quickfur.ath.cx

--- Comment #1 from hsteoh at quickfur.ath.cx ---
I'm not sure about this.  Isn't the fact that you declared the AA's value type
to be const a declaration that it cannot change once you initialize it?

If I have an array A of type const(int)[], I'd expect that I should not be able
to assign new values to A[0], otherwise it breaks the const guarantee.

Similarly, if I have an AA of type const(int)[string], I'd expect that I cannot
assign to AA["a"] once the AA is initialized, otherwise I'm violating the const
guarantee.

--


More information about the Digitalmars-d-bugs mailing list