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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: backlog3.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada.Containers.Indefinite_Holders in GNAT and Ada2012 Date: Mon, 11 Aug 2014 18:58:42 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1407801522 1076 69.95.181.76 (11 Aug 2014 23:58:42 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 11 Aug 2014 23:58:42 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:188373 Date: 2014-08-11T18:58:42-05:00 List-Id: "Victor Porton" wrote in message news:ls5tkt$6g2$1@speranza.aioe.org... > Victor Porton wrote: > >> I tried to write: >> >> Element(Object)'Access; >> >> for "Object" being a value of an instance of >> Ada.Containers.Indefinite_Holders. >> >> This does not work because the return type of Element is not aliased. > > By the way, does it makes sense in the next Ada specification to make the > return type of "Element" function aliased? Ada doesn't allow return objects to be declared "aliased". We looked at allowing that when we added "aliased" parameters, but the semantics would have been unusual at best. We couldn't figure out what it mean in various usual cases (as you note later, Ada usually allows the return to be a copy, and this is important for some kinds of types). Since it's doesn't make sense (in general) for a return object to be aliased, it couldn't make sense to allow that in a generic. Randy.