1 ------------------------------------------------------------------------------
3 -- GNAT LIBRARY COMPONENTS --
5 -- A D A . C O N T A I N E R S . G E N E R I C _ A R R A Y _ S O R T --
9 -- This specification is derived from the Ada Reference Manual for use with --
10 -- GNAT. In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification, provided that if you redistribute a --
12 -- modified version, any changes that you have made are clearly indicated. --
14 ------------------------------------------------------------------------------
17 type Index_Type
is (<>);
18 type Element_Type
is private;
19 type Array_Type
is array (Index_Type
range <>) of Element_Type
;
21 with function "<" (Left
, Right
: Element_Type
) return Boolean is <>;
23 procedure Ada
.Containers
.Generic_Array_Sort
(Container
: in out Array_Type
);
24 pragma Pure
(Ada
.Containers
.Generic_Array_Sort
);
25 -- Reorders the elements of Container such that the elements are sorted
26 -- smallest first as determined by the generic formal "<" operator provided.
27 -- Any exception raised during evaluation of "<" is propagated.
29 -- The actual function for the generic formal function "<" is expected to
30 -- return the same value each time it is called with a particular pair of
31 -- element values. It should not modify Container and it should define a
32 -- strict weak ordering relationship: irreflexive, asymmetric, transitive, and
33 -- in addition, if x < y for any values x and y, then for all other values z,
34 -- (x < z) or (z < y). If the actual for "<" behaves in some other manner,
35 -- the behavior of the instance of Generic_Array_Sort is unspecified. The
36 -- number of times Generic_Array_Sort calls "<" is unspecified.