Next: , Previous: A.18.10, Up: A.18


A.18.11 The Package Containers.Indefinite_Doubly_Linked_Lists

1/2
{20302AI95−00302−03} The language−defined generic package Containers.Indefinite_Doubly_Linked_Lists provides private types List and Cursor, and a set of operations for each type. It provides the same operations as the package Containers.Doubly_Linked_Lists (see A.18.3), with the difference that the generic formal Element_Type is indefinite.

Static Semantics

2/2
{20302AI95−00302−03} The declaration of the generic library package Containers.Indefinite_Doubly_Linked_Listshas the same contents as Containers.Doubly_Linked_Lists except:

3/2

4/2

5/2

     procedure Insert (Container in out List;
                       Before    in     Cursor;
                       Position     out Cursor;
                       Count     in     Count_Type := 1);

6/2

6.a/2

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.

7/2

Extensions to Ada 95

7.a/2

{20302AI95−00302−03} {extensions to Ada 95} The generic package Containers.Indefinite_Doubly_Linked_Lists is new.