summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cbhama.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cbhama.ads')
-rw-r--r--gcc/ada/a-cbhama.ads93
1 files changed, 51 insertions, 42 deletions
diff --git a/gcc/ada/a-cbhama.ads b/gcc/ada/a-cbhama.ads
index 4d7cfa2225b..78347c5473d 100644
--- a/gcc/ada/a-cbhama.ads
+++ b/gcc/ada/a-cbhama.ads
@@ -134,6 +134,56 @@ package Ada.Containers.Bounded_Hashed_Maps is
-- Calls Process with the key (with only a constant view) and element (with
-- a variable view) of the node designed by the cursor.
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is
+ private
+ with
+ Implicit_Dereference => Element;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type);
+
+ for Constant_Reference_Type'Write use Write;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type);
+
+ for Constant_Reference_Type'Read use Read;
+
+ type Reference_Type (Element : not null access Element_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type);
+
+ for Reference_Type'Write use Write;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type);
+
+ for Reference_Type'Read use Read;
+
+ function Constant_Reference
+ (Container : aliased Map;
+ Position : Cursor) return Constant_Reference_Type;
+
+ function Reference
+ (Container : aliased in out Map;
+ Position : Cursor) return Reference_Type;
+
+ function Constant_Reference
+ (Container : aliased Map;
+ Key : Key_Type) return Constant_Reference_Type;
+
+ function Reference
+ (Container : aliased in out Map;
+ Key : Key_Type) return Reference_Type;
+
procedure Assign (Target : in out Map; Source : Map);
-- If Target denotes the same object as Source, then the operation has no
-- effect. If the Target capacity is less then the Source length, then
@@ -286,47 +336,6 @@ package Ada.Containers.Bounded_Hashed_Maps is
function Iterate (Container : Map)
return Map_Iterator_Interfaces.Forward_Iterator'class;
- type Constant_Reference_Type
- (Element : not null access constant Element_Type) is
- private
- with
- Implicit_Dereference => Element;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Constant_Reference_Type);
-
- for Constant_Reference_Type'Write use Write;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Constant_Reference_Type);
-
- for Constant_Reference_Type'Read use Read;
-
- type Reference_Type (Element : not null access Element_Type) is private
- with
- Implicit_Dereference => Element;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Reference_Type);
-
- for Reference_Type'Write use Write;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Reference_Type);
-
- for Reference_Type'Read use Read;
-
- function Constant_Reference
- (Container : Map;
- Key : Key_Type) -- SHOULD BE ALIASED???
- return Constant_Reference_Type;
-
- function Reference (Container : Map; Key : Key_Type) return Reference_Type;
-
private
pragma Inline (Length);
pragma Inline (Is_Empty);
@@ -342,7 +351,7 @@ private
type Node_Type is record
Key : Key_Type;
- Element : Element_Type;
+ Element : aliased Element_Type;
Next : Count_Type;
end record;