On this page
Ada.Containers
The parent of the container units (RM A.18.1).
Read the family guide for representation, selection and resource rules. The complete declaration page retains exact signatures/contracts; the source specification is the implementation baseline.
Availability and ownership
Hash_Type, Count_Type and Capacity_Error as Ada declares them. The unbounded Ada containers are left out (B0501), Verada.Containers.Unbounded being their replacement.
A client proof uses these contracts without proving the body again (see library assurance). Global => null excludes package-global effects, not changes made through an in out argument.
Import and instantiate
with Ada.Containers;import Ada.Containers;
A Vibe module imports this unit's names with from Ada.Containers import Name; see library use across syntaxes. In Varc, keep each name's declared spelling and write & on arguments the call changes.
Contract and lifecycle reading
A Pre condition is the caller's obligation; a Post is what a normal return guarantees. What a postcondition does not state, a client cannot assume. Ghost functions are for contracts and ghost code. The family guide describes copying, lifetime, order and cost.
API 001
Hash_Type (declaration) — The type of hash values, modulo 2**32.
Declared interface:
type Hash_Type is mod 2 ** 32;API 002
Count_Type (declaration) — The type of container lengths and capacities.
Declared interface:
type Count_Type is range 0 .. Natural'Last;API 003
Capacity_Error (declaration) — Ada's exception for a capacity exceeded; Verada's containers state their capacity in preconditions.
Declared interface:
Capacity_Error : exception;