Groups | Search | Server Info | Login | Register


Groups > comp.lang.ada > #49640

On absurdity of collections 7.6.1 (11.1/3)

From "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups comp.lang.ada
Subject On absurdity of collections 7.6.1 (11.1/3)
Date 2021-09-29 11:09 +0200
Organization Aioe.org NNTP Server
Message-ID <sj1ah7$7kr$1@gioia.aioe.org> (permalink)

Show all headers | View raw


For Ada programmers who wonder what it is, here is a practical example. 
Given the package specification:

    package P is
       type Item (Length : Positive) is
          new Ada.Finalization.Limited_Controlled with
       record
          Text : String (1..Length);
       end record;
       overriding procedure Finalize (X : in out Item);

       type Item_Ptr is access all Item;
       function New_Item
                (  Pool : in out Root_Storage_Pool'Class;
                   Text : String
                )  return Item_Ptr;
       procedure Free is new Ada.Unchecked_Deallocation (Item, Item_Ptr);
    end P;

and the program using it like this:

    Ptr : Item_Ptr := New_Item (Some_Pool, "A");

    ...

    Free (Ptr);

Write the package body.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Back to comp.lang.ada | Previous | NextNext in thread | Find similar


Thread

On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-29 11:09 +0200
  Re: On absurdity of collections 7.6.1 (11.1/3) Simon Wright <simon@pushface.org> - 2021-09-29 12:05 +0100
    Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-29 13:20 +0200
      Re: On absurdity of collections 7.6.1 (11.1/3) Simon Wright <simon@pushface.org> - 2021-09-29 22:38 +0100
        Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 10:07 +0200
          Re: On absurdity of collections 7.6.1 (11.1/3) Simon Wright <simon@pushface.org> - 2021-09-30 09:35 +0100
            Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 10:49 +0200
          Re: On absurdity of collections 7.6.1 (11.1/3) "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-30 20:37 -0500
            Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-10-01 09:57 +0200
      Re: On absurdity of collections 7.6.1 (11.1/3) "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-29 19:23 -0500
        Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 10:06 +0200
  Re: On absurdity of collections 7.6.1 (11.1/3) "G.B." <bauhaus@notmyhomepage.invalid> - 2021-09-30 20:23 +0200
    Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 20:52 +0200
      Re: On absurdity of collections 7.6.1 (11.1/3) "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-30 20:40 -0500
        Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-10-01 09:57 +0200

csiph-web