comp.lang.ada
 help / color / mirror / Atom feed
* Hierarchy destruction in Ada
@ 2004-12-12 15:18 Michael Mounteney
  2004-12-12 15:38 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Mounteney @ 2004-12-12 15:18 UTC (permalink / raw)


Ada 95 provides a mechanism with tagged and type'class to allow
dynamic dispatch. So if one has:

procedure something (O : basetype'class) is
begin
     enact (O);
end something;

then as we all know, with the appropriate redefinitions of enact ()
for the subtypes of basetype, we have dynamic dispatch.  But what
about deallocation ? I want to declare:

type handle is access all basetype;

procedure dispose (ptr : in out handle);

and can't see how to make this deallocate the correct object.
Obviously, one can dynamically dispatch on ptr.all but it seems
impossible to solve the complete problem without an unchecked
conversion. Anyone ?



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

end of thread, other threads:[~2004-12-13 13:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-12 15:18 Hierarchy destruction in Ada Michael Mounteney
2004-12-12 15:38 ` Dmitry A. Kazakov
2004-12-12 16:52 ` Martin Krischik
2004-12-13 13:41 ` Martin Krischik

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