comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada.Containers.Indefinite_Holders in GNAT and Ada2012
Date: Mon, 11 Aug 2014 18:58:42 -0500
Date: 2014-08-11T18:58:42-05:00	[thread overview]
Message-ID: <lsblbi$11k$1@loke.gir.dk> (raw)
In-Reply-To: ls5tkt$6g2$1@speranza.aioe.org

"Victor Porton" <porton@narod.ru> 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.




  parent reply	other threads:[~2014-08-11 23:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-09 19:25 Ada.Containers.Indefinite_Holders in GNAT and Ada2012 Victor Porton
2014-08-09 19:43 ` Victor Porton
2014-08-10 13:06   ` Victor Porton
2014-08-10 15:32     ` Simon Wright
2014-08-11 11:01     ` AdaMagica
2014-08-11 15:38     ` Adam Beneschan
2014-08-11 23:58   ` Randy Brukardt [this message]
2014-08-09 21:54 ` Simon Wright
replies disabled

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