Logo

Programming-Idioms

History of Idiom 13 > diff from v37 to v38

Edit summary for version 38 by :
New Ada implementation by user [Smaehtin]

Version 37

2016-02-17, 12:00:57

Version 38

2016-02-17, 15:40:51

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Imports
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;

use Ada.Containers;
Code
for C in Map.Iterate loop
   Put_Line ("Key = " & Key (C) & ", Value = " & Element (C));
end loop;