Multi-associative array

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Feb 22 22:27:47 PST 2014


On Sat, Feb 22, 2014 at 10:10:23PM -0500, Etienne Cimon wrote:
> Would it eventually be in the making for D to have associative
> arrays like string[string, int, Item]?
> 
> If it hasn't been planned, I'd say it would be great to have an API
> that allows it to carry functionality of Boost Multi Index
[...]

You can just use a struct or tuple as the AA key to achieve the same
thing.

	struct Key {
		string x;
		int y;
		Item z;
	}

	string[Key] aa;
	aa[Key("a", 1, Item(...))] = "b";


T

-- 
Some days you win; most days you lose.


More information about the Digitalmars-d mailing list