comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Dispatching in Generics
Date: 1997/09/12
Date: 1997-09-12T00:00:00+00:00	[thread overview]
Message-ID: <EGEp1D.K6C@world.std.com> (raw)
In-Reply-To: 34183CD3.7F4@boeing.com


In article <34183CD3.7F4@boeing.com>,
Kevin Ingalls  <kevin.l.ingalls@boeing.com> wrote:
>generic
>    type T is tagged private;
>    with procedure put (T1 : T);
>package G is
>    procedure cant_dispatch(TC : T'class);
>end G;
>
>package body G is
>    procedure cant_dispatch(TC : T'class) is
>    begin
>        put (TC);	-- the error occurs here
>    end cant_dispatch;
>end G;

Would the following solve your problem?  Declare the formal type with
(<>), and pass in Whatever_Type'Class during instantiation.  Then, all
calls within the generic will necessarily be dispatching.

- Bob




  reply	other threads:[~1997-09-12  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-11  0:00 Dispatching in Generics Kevin Ingalls
1997-09-12  0:00 ` Robert A Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-06-05  0:00 Dispatching In Generics Kevin Ingalls
1997-06-07  0:00 ` Tom Moran
1997-06-09  0:00 ` John English
1997-06-09  0:00 ` 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