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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.175.25 with SMTP id y25mr2156646ioe.16.1522539417629; Sat, 31 Mar 2018 16:36:57 -0700 (PDT) X-Received: by 2002:a9d:6217:: with SMTP id g23-v6mr164181otj.11.1522539417448; Sat, 31 Mar 2018 16:36:57 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!k65-v6no700021ita.0!news-out.google.com!u64-v6ni3234itb.0!nntp.google.com!k65-v6no700017ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 31 Mar 2018 16:36:57 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.243.127.156; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.243.127.156 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: limited agregate and limited components default initialization From: Jean-Claude Rostaing <00120260a@gmail.com> Injection-Date: Sat, 31 Mar 2018 23:36:57 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:51263 Date: 2018-03-31T16:36:57-07:00 List-Id: Why does a component declaration like that: type Item_Accessor (Item: not null access Item_type) is limited record Ref: Item_access := SET(Item_Record'(Item => ITEM.all, others => <>)); end record; unconstrained subtype in component declaration ? ITEM is limited but IS constrained by the default initialisation It forced me to add the function DEFAULT_INITIALIZATION as a parameter, which I would prefer to not to. But since the result is the same, I'll drop it. Item (and the article it is in) is never meant to be left uninitialized. Also, how to get rid of the problem with function Set (Value: in Item_type) return Smart_Pointers is (Smart_Pointers'(Controlled with Node => new Accessor_type'(Data => new Item_type'(Value), Count => 1))); which gives :Initialization not allowed for limited types. So an aggregate like this is not counted as a "limited agregate" ??