assocArray

fnauto assocArray(Range)(Range r) if (isInputRange!Range)

Creates an associative array from a range of key/value tuples.

Parameters

rAn input range of Tuple!(Key, Value). Duplicates: Associative arrays have unique keys. For any duplicate key in r, the result will contain the corresponding value from the last occurrence of that key in r.

Returns

A newly allocated associative array, or a null associative array reference when

given an empty range. The type is Value[Key].

fnauto assocArray(Keys, Values)(Keys keys, Values values) if (isInputRange!Values && isInputRange!Keys)

Creates an associative array from a range of keys and a range of values.

If given two ranges of unequal lengths after the elements of the shorter are exhausted, the remaining elements of the longer will not be considered.

Parameters

keysAn input range of keys
valuesAn input range of values Duplicates: Associative arrays have unique keys. For any key with duplicates in keys, the result will have the corresponding value for the last occurrence of that key in keys.

Returns

A newly allocated associative array, or a null associative array reference when

given empty ranges.