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 10.36.161.13 with SMTP id y13mr2631221ite.27.1519425004667; Fri, 23 Feb 2018 14:30:04 -0800 (PST) X-Received: by 10.157.96.5 with SMTP id h5mr98278otj.14.1519425004583; Fri, 23 Feb 2018 14:30:04 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!news.roellig-ltd.de!open-news-network.org!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!o66no947296ita.0!news-out.google.com!s63ni2849itb.0!nntp.google.com!o66no947286ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 23 Feb 2018 14:30:04 -0800 (PST) In-Reply-To: <93229821-ae3d-4e47-91d9-a20ff3c1f1a7@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.113.16.86; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 76.113.16.86 References: <93229821-ae3d-4e47-91d9-a20ff3c1f1a7@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: two questions on allocators From: Shark8 Injection-Date: Fri, 23 Feb 2018 22:30:04 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 3158457477 X-Received-Bytes: 2666 Xref: reader02.eternal-september.org comp.lang.ada:50617 Date: 2018-02-23T14:30:04-08:00 List-Id: On Friday, February 23, 2018 at 1:42:14 PM UTC-7, Mehdi Saada wrote: > 2.2/3: for an allocator with a subtype indication, the subtype indication shall not specify a null exclusion > why > type A is access INTEGER; > type B is access not null A; > type C is access B; > Object_C : C := new B; > is allowed, but not > type A is access INTEGER; > type B is access A; > type C is access B; > Object_C : C := new not null B; ?? What's the difference ? Lots. In the first one, A is an access to an integer, B is an access to A (with null exclusion), and C is an access to B... so in C/C++ something like int*, int**, and int***, respectively. The second is the same insofar as the C/C++ analog is concerned; but it's different in that B doesn't exclude Null. Finally, the phrase "new not null B" is in error, as you cannot say "new not null" in Ada. > If the designated type of the allocator is class-wide, the accessibility level of the type determined by the subtype_indication or qualified_expression shall not be statically deeper than that of the type of the allocator. > > -> what means the last "type of the allocator" ? Is it the same than "designed type of the allocator" ? The type of the allocator refers to a concrete instance of System.Storage_Pools.Root_Storage_Pool which can be associated with an access-type via pragma/aspect.