A.18.14 The Generic Package Containers.Indefinite_Ordered_Maps
The language-defined generic package Containers.Indefinite_Ordered_Maps
provides a map with the same operations as the package Containers.Ordered_Maps
), with the difference that the
generic formal types Key_Type and Element_Type are indefinite.
The declaration of the generic library package Containers.Indefinite_Ordered_Maps
has the same contents and semantics as Containers.Ordered_Maps except:
The generic formal Key_Type is indefinite.
The generic formal Element_Type is indefinite.
The procedure with
procedure Insert (Container : in out Map;
Key : in Key_Type;
Position : out Cursor;
Inserted : out Boolean);
Discussion: This procedure is omitted
because there is no way to create a default-initialized object of an
indefinite type. We considered having this routine insert an empty element
similar to the empty elements of a vector, but rejected this possibility
because the semantics are fairly complex and very different from the
existing case. That would make it more error-prone to convert a container
from a definite type to an indefinite type; by omitting the routine completely,
any problems will be diagnosed by the compiler.
The actual Element parameter of access subprogram
Process of Update_Element may be constrained even if Element_Type is
The operations Include, Insert, Replace, and Replace_Element
that have a formal parameter of type Element_Type perform indefinite
insertion (see A.18).
of the named operations also have a formal of the indefinite formal type
Key_Type and perform indefinite insertion using that value, but it is
sufficient to mention the formal of type Element_Type to cover those.
Extensions to Ada 95
The generic package Containers.Indefinite_Ordered_Maps
Inconsistencies With Ada 2012
some routines to “perform indefinite insertion”. This could
mean that some calls to those routines would now raise Program_Error
where they previously worked. However, this is extremely unlikely; see
Inconsistencies With Ada 2012 in A.18.11
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe