comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon.j.wright@mac.com>
Subject: Re: Generic instantiation with constrained subtype
Date: Sat, 23 Aug 2008 21:24:46 +0100
Date: 2008-08-23T21:24:46+01:00	[thread overview]
Message-ID: <m27ia7o4xd.fsf@mac.com> (raw)
In-Reply-To: RfZrk.255774$TT4.77223@attbi_s22

"Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org> writes:

> Simon Wright wrote:
>>
>>       type T is new Base with private;
>
> type T (<>) is new Base with private;
>
> eliminates the compiler errors. It may not be suitable for your needs,
> however.

Hmm, I need to be able to say

   generic
      type T (<>) is new Base with private;
   package G is
      O : T;
   end G;

Ah! I can provide an initialising value!

   generic
      type T (<>) is new Base with private;
      V : T;
   package G is
      O : T := V;
   end G;

   A : Constrained;

   package F is new G (Constrained, A);

-- and it works fine! Thanks for the help ..



      reply	other threads:[~2008-08-23 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-23 12:59 Generic instantiation with constrained subtype Simon Wright
2008-08-23 19:09 ` Jeffrey R. Carter
2008-08-23 20:24   ` Simon Wright [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