comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: limited agregate and limited components default initialization
Date: Sun, 1 Apr 2018 22:42:48 -0500
Date: 2018-04-01T22:42:48-05:00	[thread overview]
Message-ID: <p9s8rp$mvd$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 29943b13-00d1-443a-82f2-f55272770109@googlegroups.com


"Jean-Claude Rostaing" <00120260a@gmail.com> wrote in message 
news:29943b13-00d1-443a-82f2-f55272770109@googlegroups.com...
> the smart pointer is NOT limited, but ITEM_TYPE is. Simply because I want 
> to accept as many type as possible.
>
> generic
>   type Item_type(<>) is limited private;
> package Pointers is
>   type Accessor_type(Data: not null access Item_type) is limited private 
> with Implicit_Dereference => Data;
>   type Smart_Pointers(<>) is private;
>   NULL_ACCESS: Constant Smart_Pointers;
>
> I could ask a constructor as a parameter, but it would be stupid since 
> clients whou would want to instanciate with a limited type, won'obviously 
> wouldn't be able to provide a constructor.
>
> I'm waiting for a solution... Randy the savior ?

A limited type can have a constructor function -- it just has to really 
construct the type, not copy it as you are doing in your examples. It won't 
work to solve *every* problem, but it will solve most. (Dmitry is a little 
too pessimistic in his assessment.)

               Randy.



  parent reply	other threads:[~2018-04-02  3:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 23:36 limited agregate and limited components default initialization Jean-Claude Rostaing
2018-04-01  0:52 ` Jere
2018-04-01  1:12   ` Jere
2018-04-01  1:16   ` Jean-Claude Rostaing
2018-04-01  1:34     ` Jere
2018-04-01  2:07       ` Jean-Claude Rostaing
2018-04-01  2:40         ` Jere
2018-04-01  2:54           ` Jere
2018-04-01  3:14         ` Jere
2018-04-01  3:31           ` Jere
2018-04-01  9:32         ` Jacob Sparre Andersen
2018-04-01 12:58           ` Jean-Claude Rostaing
2018-04-01 13:33 ` Dmitry A. Kazakov
2018-04-01 15:46   ` Jean-Claude Rostaing
2018-04-01 15:53     ` Jean-Claude Rostaing
2018-04-01 15:54       ` Jean-Claude Rostaing
2018-04-01 21:31       ` Dmitry A. Kazakov
2018-04-02  3:44         ` Randy Brukardt
2018-04-02 11:25           ` Jean-Claude Rostaing
2018-04-02 12:11             ` Dmitry A. Kazakov
2018-04-02 12:15             ` Jean-Claude Rostaing
2018-04-02 21:37             ` Randy Brukardt
2018-04-03 17:01               ` Jeffrey R. Carter
2018-04-05 10:27           ` AdaMagica
2018-04-02  3:42     ` Randy Brukardt [this message]
2018-04-01 22:52 ` Jean-Claude Rostaing
2018-04-01 23:36   ` Jean-Claude Rostaing
2018-04-01 23:39     ` Jean-Claude Rostaing
2018-04-02 18:19       ` Jere
2018-04-02 18:50         ` Dmitry A. Kazakov
2018-04-02 19:46           ` Jere
2018-04-02 19:59             ` Dmitry A. Kazakov
2018-04-02 21:03               ` Jean-Claude Rostaing
2018-04-03  8:14                 ` Dmitry A. Kazakov
2018-04-03  1:27             ` Dennis Lee Bieber
2018-04-02 22:39     ` Robert I. Eachus
2018-04-03 18:18 ` Jean-Claude Rostaing
2018-04-03 18:28   ` Jean-Claude Rostaing
2018-04-03 19:18   ` Jeffrey R. Carter
2018-04-03 19:25     ` Jean-Claude Rostaing
2018-04-03 20:12       ` Jeffrey R. Carter
2018-04-03 22:37         ` Jean-Claude Rostaing
2018-04-04  2:18   ` Jere
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox