comp.lang.ada
 help / color / mirror / Atom feed
* run-time type identification
@ 1998-09-03  0:00 Bob Fletcher
  1998-09-03  0:00 ` Matthew Heaney
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Bob Fletcher @ 1998-09-03  0:00 UTC (permalink / raw)


Is there any equivalent in Ada 95 to the C++ "dynamic_cast" operator?

For example, say you have a class A, and a derived class A2.
In the package for class A there is also:
	type A_Ptr is access A'Class;
You can assign an access to an object of class A2 to a variable of type
A_Ptr, but, as far as I know, cannot then de-reference the A_Ptr in such a
way that the extra bits of class A2 are accessible.

It seems to me that this is something that would make a lot of sense when
dealing with class-wide access types, which can easily be used to go up the
object heirarchy, but not, as far as I know, to go back down, (without
messing about with unchecked_conversion).

Bob Fletcher
bob@radge.globalnet.co.uk




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~1998-09-06  0:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-03  0:00 run-time type identification Bob Fletcher
1998-09-03  0:00 ` Matthew Heaney
1998-09-03  0:00   ` Bob Fletcher
1998-09-03  0:00     ` Matthew Heaney
1998-09-03  0:00 ` Steve Sabljak
1998-09-03  0:00   ` Steve Sabljak
1998-09-03  0:00   ` Matthew Heaney
1998-09-03  0:00 ` Samuel Tardieu
1998-09-03  0:00   ` Bob Fletcher
1998-09-03  0:00     ` Fergus Henderson
1998-09-03  0:00     ` Matthew Heaney
1998-09-06  0:00       ` Samuel Tardieu
1998-09-03  0:00 ` Tucker Taft

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