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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f8a440310f7f2e02 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!8g2000hse.googlegroups.com!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: Extended return question Date: Fri, 11 Jul 2008 02:06:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <69940bd4-74f7-4b00-93d6-482c7394fcef@34g2000hsf.googlegroups.com> <1pdpniur1w9sq$.1a9h7prydviae$.dlg@40tude.net> <1q2ekbsy00n1q.su55mffvj33u$.dlg@40tude.net> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1215767177 10422 127.0.0.1 (11 Jul 2008 09:06:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 11 Jul 2008 09:06:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 8g2000hse.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 webwasher (Webwasher 6.7.0.3295) Xref: g2news1.google.com comp.lang.ada:1107 Date: 2008-07-11T02:06:17-07:00 List-Id: On 11 Jul., 09:39, "Dmitry A. Kazakov" wrote: > On Thu, 10 Jul 2008 20:43:09 -0400, Robert A Duff wrote: > > I don't see any problem here. =A0The "notion of limited type" is "do no= t > > copy". =A0In the example below, X is created, then destroyed, then anot= her > > X is created, and that becomes the result. =A0No copying. > > No, we cannot say that, because > > A) X is not created until the constructing function returns. There is jus= t > no X until that point. The question is *what* was created and destroyed? = It > is improperly typed, at least. > > B) On the other hand, if we considered X being created, destroyed and > created again, then the name X would resolve into two different objects i= n > the same context. This would either violate the identity semantics of X o= r > be semantically equivalent to an assignment of X. I view it this way: There is a certain storage region where something (first X) is created and then distroyed. There is again a certain storage region (may be the same, may be not) where the second X is created. Only when the function returns becomes this storage region known a the final limited object. No copying.