Logo

Programming-Idioms

History of Idiom 13 > diff from v38 to v39

Edit summary for version 39 by :
[Ada] Map name is mymap

Version 38

2016-02-17, 15:40:51

Version 39

2016-02-17, 16:11:57

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;
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;
Code
for C in MyMap.Iterate loop
   Put_Line ("Key = " & Key (C) & ", Value = " & Element (C));
end loop;