From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Two class-wide operands, but only one controlling
Date: 25 Nov 2002 11:19:02 -0800
Date: 2002-11-25T19:19:03+00:00 [thread overview]
Message-ID: <1ec946d1.0211251119.3399add2@posting.google.com> (raw)
In-Reply-To: 3ddfa8b8$0$304$bed64819@news.gradwell.net
porton@ex-code.com (Victor Porton) wrote in message news:<3ddfa8b8$0$304$bed64819@news.gradwell.net>...
> I want something like a procedure with two class-wide operands,
> (of two different types) but only one of these controlling.
>
> The solution I found is introducing new tagged record
> types which would refer to these two types and passing both
> operands as one operand in such the record. Other solutions?
No, you don't need two separate types. Just declare the second
parameter as type T'Class, e.g.
type T is tagged ...;
procedure Op (O1 : T; O2 : T'Class);
Now procedure Op only dispatches according to the tag of O1.
If you want two separate types, then just do this:
procedure Op (O1 : T; O2 : T2'Class);
prev parent reply other threads:[~2002-11-25 19:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-23 16:10 Two class-wide operands, but only one controlling Victor Porton
2002-11-23 19:50 ` Pascal Obry
2002-11-24 8:27 ` Victor Porton
2002-11-24 8:59 ` Samuel Tardieu
2002-11-24 11:34 ` Victor Porton
2002-11-24 21:56 ` Pascal Obry
2002-11-25 22:17 ` Matthew Heaney
2002-11-27 17:25 ` Matthew Heaney
2002-11-25 19:19 ` Matthew Heaney [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