From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:2e10:: with SMTP id i16-v6mr989972ita.36.1522693181767; Mon, 02 Apr 2018 11:19:41 -0700 (PDT) X-Received: by 2002:a9d:58c9:: with SMTP id s9-v6mr613025oth.0.1522693181689; Mon, 02 Apr 2018 11:19:41 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!1.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u184-v6no4253898ita.0!news-out.google.com!d3-v6ni2277itf.0!nntp.google.com!k65-v6no2456792ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 2 Apr 2018 11:19:41 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.71.218.250; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 173.71.218.250 References: <853b698c-204b-4a5e-a486-b2d7cb664b3a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4834a1b9-6ae2-4806-8022-02bbcc88765f@googlegroups.com> Subject: Re: limited agregate and limited components default initialization From: Jere Injection-Date: Mon, 02 Apr 2018 18:19:41 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2706 X-Received-Body-CRC: 2029904914 Xref: reader02.eternal-september.org comp.lang.ada:51299 Date: 2018-04-02T11:19:41-07:00 List-Id: On Sunday, April 1, 2018 at 7:39:19 PM UTC-4, Jean-Claude Rostaing wrote: > Ok, now I know why what I wanted to do was impossible. To store an object= into an accessor or whatever, or to create it with allocator, with only a = given "value" of this limited type, you need to COPY this value, whatever y= ou do. Which goes against the very idea of limited type. > I feel more intelligent thanks to that... > And I know why though ITEM_TYPE is indefinite limited, you can only trans= late from its POINTER to a smart pointer, never directly from a value of th= at limited type. Something else unrelated to your question, but that I just noticed: Assumin= g you could have gotten a list definition that you were happy with, there is still a very serious problem with it. Doubly linked lists (ones that use both Next and Prev/Pred) are susceptible to "circular references" when usin= g reference counting smart pointers. You would need to use a weak reference based smart pointer for one of the two (either Next or Prev/Pred, whichever you prefer). -- very simple/silly example type Node is Value : Item_Type; Next : Smart_Pointer_Type; Prev : Weak_Smart_Pointer_Type; end Node;