Build AA from two simple array

Alex sascha.orlov at gmail.com
Sat Mar 23 09:32:08 UTC 2019


On Saturday, 23 March 2019 at 09:25:52 UTC, Andrey wrote:
> Hello,
> I have got 2 simple arrays with the same length:
>> int[] values = [1, 2, 3, 4, 5];
>> char[] keys = ['a', 'b', 'c', 'd', 'e'];
>>  auto result = buildAA(keys, values); // [a: 1, b: 2, c: 3, d: 
>> 4, e: 5]
>
> I want to build AA "result" using "values" and "keys". How to 
> do it?

for example via assocArray

https://dlang.org/library/std/array/assoc_array.html


More information about the Digitalmars-d-learn mailing list