From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Extended return question
Date: Thu, 10 Jul 2008 20:50:25 -0400
Date: 2008-07-10T20:50:25-04:00 [thread overview]
Message-ID: <wcc63rdqm5q.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 77279091-112d-46ef-9e26-f83497a66bd5@2g2000hsn.googlegroups.com
Adam Beneschan <adam@irvine.com> writes:
> On Jul 10, 4:20 pm, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
>> "Dale Stanbrough" <MrNoS...@bigpoop.net.au> wrote in message
>>
>> news:MrNoSpam-BCD9C2.17322110072008@news-server.bigpond.net.au...
>>
>> > Georg Bauhaus wrote:
>>
>> >> Dale Stanbrough wrote:
>> >> > The purpose of an extended return is to create the values in-situ
>> >> > without copying.
>>
>> >> _Limited_ objects can be initialized in situ by an aggregate
>> >> or function call ... :-)
>>
>> > Ah, thanks. I had misread John Barnes comments on this. Why such a
>> > restriction? Why not allow it for all extended returns on all types?
>>
>> Build-in-place is *allowed* for all objects; it is only *required* for types
>> that always have to be limited (now known as "immutably limited types" (see
>> AI05-0052-1).
>
> Where does the RM say that build-in-place is allowed for all objects?
> The only place I can see that refers to build-in-place for nonlimited
> objects is 7.6(21), and that permission seems to apply only to
> controlled objects.
>
> Also, the language there says that if a function call is assigned into
> a target object, an anonymous object doesn't need to be created if the
> value of the function call can be "safely" created in the target
> object. But "safely" isn't defined. If the function could create
> part of the target object and then terminate on an exception, as in
> Dale's original example, is that considered "unsafe", which would mean
> build-in-place isn't allowed for this function call? If it doesn't
> mean that, what does "safely" mean?
For:
X := F(...);
the language rules require that X not be modified in case of exceptions
in F. Of course the type of X is nonlimited here.
- Bob
next prev parent reply other threads:[~2008-07-11 0:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 2:11 Extended return question Dale Stanbrough
2008-07-10 7:18 ` Georg Bauhaus
2008-07-10 7:32 ` Dale Stanbrough
2008-07-10 15:24 ` Adam Beneschan
2008-07-10 23:56 ` Dale Stanbrough
2008-07-10 23:20 ` Randy Brukardt
2008-07-11 0:03 ` Adam Beneschan
2008-07-11 0:50 ` Robert A Duff [this message]
2008-07-10 14:37 ` Robert A Duff
2008-07-10 15:19 ` Adam Beneschan
2008-07-10 18:36 ` Dmitry A. Kazakov
2008-07-11 0:43 ` Robert A Duff
2008-07-11 7:39 ` Dmitry A. Kazakov
2008-07-11 9:06 ` christoph.grein
2008-07-11 14:24 ` Dmitry A. Kazakov
2008-07-11 0:29 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox