Rationale for Ada 2005
8.6 Sorting
The
final facilities in the container library are generic procedures for
array sorting. There are two versions, one for unconstrained arrays and
one for constrained arrays. Their specifications are
generic
type Index_Type is (<>);
type Element_Type is private;
type Array_Type is array (Index_Type range <>) of Element_Type;
with function "<" (Left, Right: Element_Type) return Boolean is <>;
procedure Ada.Containers.Generic_Array_Sort(Container: in out Array_Type);
pragma Pure(Ada.Containers.Generic_Array_Sort);
generic
type Index_Type is (<>);
type Element_Type is private;
type Array_Type is array (Index_Type) of Element_Type;
with function "<" (Left, Right: Element_Type) return Boolean is <>;
procedure Ada.Containers.Generic_Constrained_Array_Sort(Container: in out Array_Type);
pragma Pure(Ada.Containers.Generic_Constrained_Array_Sort);
These do the obvious thing. They sort the array Container
into order as defined by the generic parameter "<".
The emphasis is on speed.
© 2005, 2006 John Barnes Informatics.
Sponsored in part by: