comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: Allocators for anonymous access return types
Date: Sun, 31 Oct 2010 15:28:49 +0100
Date: 2010-10-31T15:28:49+01:00	[thread overview]
Message-ID: <877hgyzba6.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: iajtcf$1qc$1@news.eternal-september.org

* J-P. Rosen:

>>    type Variadic is tagged limited private;
> My first reaction would be to define here:
>      type Variadic access is access Variadic;

"type Variadic_Access is access Variadic;"?

It's difficult to get exception-safe code that way.  Deallocating the
parameters in Print is not sufficient because you leak memory when
constructing one of the arguments raises an exception.

> But you mention:
>> (My other example avoids copying, and seems to be safe according to
>> the ARM rules, as long as you don't declare something involving the
>> Unchecked_* types.  A solution based on anonymous access types might
>> make this violation impossible, hence my interest in them.)

> I don't know what you mean by Unchecked_* types. I guess you mean no use
> of Unchecked_Conversion? Better use a restriction then.

Oops, I was referring to the Ref type in
<87fwvn51mz.fsf@mid.deneb.enyo.de> (it's called
Unchecked_Parameter_Reference in the actual code, and for good
reason).



      reply	other threads:[~2010-10-31 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 12:18 Allocators for anonymous access return types Florian Weimer
2010-10-31 12:46 ` J-P. Rosen
2010-10-31 13:23   ` Florian Weimer
2010-10-31 14:10     ` J-P. Rosen
2010-10-31 14:28       ` Florian Weimer [this message]
replies disabled

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