OSDN Git Service

PR other/52438
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-ciormu.ads
index c1d81d5..cfd1676 100644 (file)
@@ -35,6 +35,7 @@
 private with Ada.Containers.Red_Black_Trees;
 private with Ada.Finalization;
 private with Ada.Streams;
+with Ada.Iterator_Interfaces;
 
 generic
    type Element_Type (<>) is private;
@@ -50,7 +51,10 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
    --  Returns False if Left is less than Right, or Right is less than Left;
    --  otherwise, it returns True.
 
-   type Set is tagged private;
+   type Set is tagged private
+   with Default_Iterator => Iterate,
+        Iterator_Element => Element_Type;
+
    pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
@@ -64,6 +68,12 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
    --  The default value for cursor objects declared without an explicit
    --  initialization expression.
 
+   function Has_Element (Position : Cursor) return Boolean;
+   --  Equivalent to Position /= No_Element
+
+   package Set_Iterator_Interfaces is new
+     Ada.Iterator_Interfaces (Cursor, Has_Element);
+
    function "=" (Left, Right : Set) return Boolean;
    --  If Left denotes the same set object as Right, then equality returns
    --  True. If the length of Left is different from the length of Right, then
@@ -286,9 +296,6 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
    function Contains (Container : Set; Item : Element_Type) return Boolean;
    --  Equivalent to Container.Find (Item) /= No_Element
 
-   function Has_Element (Position : Cursor) return Boolean;
-   --  Equivalent to Position /= No_Element
-
    function "<" (Left, Right : Cursor) return Boolean;
    --  Equivalent to Element (Left) < Element (Right)
 
@@ -333,6 +340,15 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
    --  Call Process with a cursor designating each element equivalent to Item,
    --  in order from Container.Ceiling (Item) to Container.Floor (Item).
 
+   function Iterate
+     (Container : Set)
+      return Set_Iterator_Interfaces.Reversible_Iterator'class;
+
+   function Iterate
+     (Container : Set;
+      Start     : Cursor)
+      return Set_Iterator_Interfaces.Reversible_Iterator'class;
+
    generic
       type Key_Type (<>) is private;