Asssociative Array by Key-Value-Pair

Tobias Pankrath via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 15 09:37:13 PST 2014


>
> You can add an eager pairs() function to Phobos that returns an 
> array of tuples.
>
> byPairs can't be done in object.d for the dependency from 
> tuples that aren't yet (and perhaps never) built-in in D, and 
> it can't be done in Phobos because it needs access to 
> unspecified runtime functions.
>
> Bye,
> bearophile

I think we should require byKeys and byValues to iterate the 
elements in the same order. Than we can just zip them for the 
pairwise iteration.

Would this impose a performance problem with the current 
implementation?


More information about the Digitalmars-d-learn mailing list