From: Axel Druesnes <druesnes.remove@noos.fr>
Subject: Newbie Ada
Date: Fri, 30 Apr 2004 14:17:30 +0200
Date: 2004-04-30T12:18:19+00:00 [thread overview]
Message-ID: <409243DA.2000906@noos.fr> (raw)
Hi there,
i am currently writing a generic package. Despite being really generic
one (at least) particular type need a special handling in two functions.
I am therefore wondering how i can either detect the type... So far i
thought of calling an overloaded function with a variable of the generic
type as a parameter which would return a special identifier for this
type but Ada doesn't allow me to call the said function as it consider
the generic type to be a type of itself instead of a placeholder for the
real type before the generic package is specialized.
Any suggestion about how i could call a function with the generic type
as a parameter without creating errors ? Other ways to detect types is
welcolme ( i can't use an enumeration value in place of a type in this
case )
ex:
function Type_Id ( Value : in Boolean ) return E_Type_Id;
function Type_Id ( Value : in Integer ) return E_Type_Id;
-- Inside the body
procedure I_Need_The_Type ( Value : Generic_Type )
...
Type_Identifier := Type_Id ( Value ); -- i wish it worked here
Axel Druesnes
next reply other threads:[~2004-04-30 12:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-30 12:17 Axel Druesnes [this message]
2004-04-30 12:22 ` Newbie Ada Preben Randhol
2004-04-30 13:20 ` Hyman Rosen
2004-04-30 13:54 ` Type detection Björn Persson
2004-04-30 15:04 ` Marius Amado Alves
2004-05-01 0:28 ` Robert I. Eachus
2004-05-01 5:01 ` James Rogers
2004-05-01 7:12 ` Robert I. Eachus
2004-05-01 12:43 ` Björn Persson
2004-05-01 12:42 ` Björn Persson
2004-04-30 14:49 ` Newbie Ada Lutz Donnerhacke
2004-05-02 13:33 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox