`update` and `require` properties for AA

Mike Franklin slavo5150 at yahoo.com
Tue Jun 26 07:25:09 UTC 2018


On Tuesday, 26 June 2018 at 07:05:44 UTC, Vasniktel wrote:
> Hello everyone.
> I am wondering about `update` and `require` properties of AAs 
> which are mentioned to be present here: 
> https://dlang.org/spec/hash-map.html#properties
> However, this code doesn't compile:
> ```
> import std.stdio;
> void main()
> {
>     class C{}
> 	int[C] aa;
>
> 	auto a = aa.require("a", new C());
> }
> ```
> Notice that this is the very code from the specification.
> Compiler says: "Error: no property require for type int[C]".
> The same situation with `update` property.
> So, I'm wondering is this a bug of some kind or just the spec 
> isn't updated.
>
> Thank you.

I think the documentation gets published prematurely.  The new 
methods for the associative arrays should come in the next 
release, scheduled for July 1st.  
https://dlang.org/changelog/pending.html#require_update

Mike


More information about the Digitalmars-d mailing list