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;
-- 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;
-- 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
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)
-- 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;