Logo

Programming-Idioms

History of Idiom 8 > diff from v4 to v5

Edit summary for version 5 by :

Version 4

2015-08-19, 14:08:18

Version 5

2015-08-20, 15:34:27

Idiom #8 Initialize a new Map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Idiom #8 Initialize a new Map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Code
int[string] x = ["one": 1, "two": 2];
Comments bubble
Could also use 'auto' for x's type, as associative array literal syntax defines its type.