Bug 3962 – AssociativeArray!(K,V) .init has no [ ] operator

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2010-03-14T14:13:00Z
Last change time
2014-02-15T02:46:05Z
Assigned to
andrei
Creator
philippe.sigaud
Blocks
4723

Comments

Comment #0 by philippe.sigaud — 2010-03-14T14:13:41Z
This code doesn't work: auto aa = (int[int]).init; // aa is an AssociativeArray!(int,int) aa[3] = 2; // Error, no [] operator overload for type AssociativeArray!(int,int) whereas this works, obviously: int[int] aa; aa[3] = 2; It's problematic for generic code and for template constraints where .init is the only way to get a value from a type.
Comment #1 by code — 2011-08-04T02:14:18Z
*** This issue has been marked as a duplicate of issue 6433 ***