3 with Ada
.Containers
.Hashed_Maps
;
6 procedure Renaming15
is
9 subtype String_T
is String (1 .. 3);
11 function Hash
(Aircraft_Id
: Integer) return Hash_Type
is
12 (Hash_Type
(Aircraft_Id
) * (2 ** 31 - 1));
13 function Equal
(Left
, Right
: Integer) return Boolean is (Left
= Right
);
14 package Radar_Map
is new Hashed_Maps
(Integer, String_T
, Hash
, Equal
);
16 Radars
: Radar_Map
.Map
;
18 procedure Change_Elem_Value
is
20 for C
in Radars
.Iterate
loop
22 E
: String_T
renames Radar_Map
.Element
(C
);
24 E
:= "Xyz"; -- { dg-error "left hand side of assignment must be a variable" }
25 Ada
.Text_IO
.Put_Line
(E
);
28 end Change_Elem_Value
;
30 Radars
.Include
(1, "jjj");