comp.lang.ada
 help / color / mirror / Atom feed
From: Nige <nigel.scott@uk.thalesgroup.com>
Subject: Re: Using controlled types to trace program execution
Date: Wed, 27 Feb 2002 11:44:45 +0000
Date: 2002-02-27T11:43:04+00:00	[thread overview]
Message-ID: <3C7CC6AD.493A1E54@uk.thalesgroup.com> (raw)
In-Reply-To: SrQe8.48019$Lp7.2214638807@newssvr14.news.prodigy.com

tmoran@acm.org wrote:
> 
   A combination will do the job.
>   You can't pass a string as a discriminant to your controlled type, and if
> you pass an access-to-string type it will be a constant and you won't
> be able to "free" the string.  But you can do it with two levels:
>   type p is access string;
>   type t(msg : access p) is new ada.finalization.limited_controlled with ...
> Then use the generic instantiation as a shorthand for declaring an
> aliased pointer to a new string'("something") followed by a declaration
> of the controlled type with a 'access to that pointer as its parameter.

Thanks - I hadn't thought about declaring a package - only a variable.

Nige



  reply	other threads:[~2002-02-27 11:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-26 13:39 Using controlled types to trace program execution Nige
2002-02-26 18:26 ` tmoran
2002-02-27 11:44   ` Nige [this message]
2002-03-06 15:20 ` Matthew Heaney
2002-03-07  8:56   ` Nige
2002-03-07 16:43     ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2002-02-27 11:55 Christoph Grein
2002-02-27 17:59 ` Jeffrey Carter
2002-02-28 15:24   ` Nige
replies disabled

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