Ada Programming/Libraries/Ada.Containers.Indefinite Holders


Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

This language feature has been introduced in Ada 2012.Category:Book:Ada Programming/Ada 2012 feature#Ada.Containers.Indefinite Holders Ada.Containers.Indefinite_Holders is a unit of the Predefined Language Environment since Ada 2012.

Category:Book:Ada Programming/Unfinished module#Ada.Containers.Indefinite%20Holders

Specification

--                     Standard Ada library specification
--   Copyright (c) 2004-2016 AXE Consultants
--   Copyright (c) 2004, 2005, 2006 Ada-Europe
--   Copyright (c) 2000 The MITRE Corporation, Inc.
--   Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
--   SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
-- -------------------------------------------------------------------------

generic
   type Element_Type (<>Category:Book:Ada Programming/Pages containing deprecated templates) is private;
   with function "=" (Left, Right : Element_Type) return Boolean is <>Category:Book:Ada Programming/Pages containing deprecated templates;
package Ada.Containers.Indefinite_Holders is
   pragma Preelaborate(Indefinite_Holders);
   pragma Remote_Types(Indefinite_Holders);

   type Holder is tagged private;
   pragma Preelaborable_Initialization (Holder);

   Empty_Holder : constant Holder;

   function "=" (Left, Right : Holder) return Boolean;

   function To_Holder (New_Item : Element_Type) return Holder;

   function Is_Empty (Container : Holder) return Boolean;

   procedure Clear (Container : in out Holder);

   function Element (Container : Holder) return Element_Type;

   procedure Replace_Element (Container : in out Holder;
                              New_Item  : in     Element_Type);

   procedure Query_Element
  (Container : in Holder;
   Process   : not null access procedure (Element : in Element_Type));

   procedure Update_Element
  (Container : in out Holder;
   Process   : not null access procedure (Element : in out Element_Type));

   type Constant_Reference_Type
      (Element : not null access constant Element_Type) is private
   with Implicit_Dereference =>Category:Book:Ada Programming/Pages containing deprecated templates Element;

   type Reference_Type (Element : not null access Element_Type) is private
   with Implicit_Dereference =>Category:Book:Ada Programming/Pages containing deprecated templates Element;

   function Constant_Reference (Container : aliased in Holder)
   return Constant_Reference_Type;

   function Reference (Container : aliased in out Holder)
   return Reference_Type;

   procedure Assign (Target : in out Holder; Source : in Holder);

   function Copy (Source : Holder) return Holder;

   procedure Move (Target : in out Holder; Source : in out Holder);

private

    --  not specified by the language

end Ada.Category:Book:Ada Programming/Pages containing deprecated templatesContainers.Category:Book:Ada Programming/Pages containing deprecated templatesIndefinite_Holders;

See also

Wikibook

External examples

Ada Reference Manual

Ada 2012

Open-Source Implementations

FSF GNAT

drake

Category:Book:Ada Programming#Libraries/Ada.Containers.Indefinite%20Holders%20
Category:Book:Ada Programming Category:Book:Ada Programming/Ada 2012 feature Category:Book:Ada Programming/Pages containing deprecated templates Category:Book:Ada Programming/Unfinished module