Logo

Programming-Idioms

History of Idiom 13 > diff from v39 to v40

Edit summary for version 40 by :
[Ada] Mixed_Case_With_Underscores : MyMap -> My_Map

Version 39

2016-02-17, 16:11:57

Version 40

2016-02-17, 17:10:56

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