Associative arrays

H. S. Teoh hsteoh at quickfur.ath.cx
Mon May 10 18:31:20 UTC 2021


On Mon, May 10, 2021 at 05:31:21PM +0000, Imperatorn via Digitalmars-d wrote:
> Sooo, when are we implementing this? 😁
> 
> https://dlang.org/spec/hash-map.html#static_initialization

This has been on the list for many years, and I haven't seen any signs
of it manifesting any time soon.

In the meantime, you could simply do this:

	static immutable K[V] myAA;
	static this() {
		myAA = [
			"abc": 123,
			... // etc.
		];
	}


T

-- 
If you think you are too small to make a difference, try sleeping in a closed room with a mosquito. -- Jan van Steenbergen


More information about the Digitalmars-d mailing list