aa.keys, synchronized and shared

torhu torhu at yahoo.com
Mon Nov 14 15:57:51 UTC 2022


On Monday, 14 November 2022 at 07:57:16 UTC, Kagamin wrote:
> This works for me:
> ```
> shared SyncAA!(string,string) saa;
> void f()
> {
> 	saa=new shared SyncAA!(string,string)("1","2");
> 	saa.keys();
> 	saa["12"]="34";
> 	saa.remove("12");
> }
> ```

The strange error message I got was because I initialized the 
variable at module level, that doesn't work when you have a 
constructor. It worked when I moved it into a module constructor.


More information about the Digitalmars-d-learn mailing list