From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Deallocating list of polymorphic objects?
Date: Thu, 30 Nov 2006 19:05:07 -0500
Date: 2006-11-30T19:05:07-05:00 [thread overview]
Message-ID: <wcc3b80v5u4.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1164930027.758923.119740@h54g2000cwb.googlegroups.com
"Michael Rohan" <mrohan@ACM.ORG> writes:
> Since I want the deallocation to be dispatching, it needs to take an
> access parameter which is then converted to a pointer for the object
> being deallocated, e.g., an Integer_Pointer, and then passed to an
> Unchecked_Deallocation procedure.
You don't need to do all that by hand. It's OK to pass
access-to-classwide to Unchecked_Deallocation. It will do
the necessary dispatching internally.
But, to be safe, you should ensure that the result type of each "new" is
the same as the type passed to Unchecked_Deallocation.
- Bob
next prev parent reply other threads:[~2006-12-01 0:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-30 23:40 Deallocating list of polymorphic objects? Michael Rohan
2006-12-01 0:05 ` Robert A Duff [this message]
2006-12-01 6:41 ` Simon Wright
2006-12-01 1:24 ` Randy Brukardt
2006-12-01 8:57 ` Maciej Sobczak
2006-12-01 12:33 ` Matthew Heaney
2006-12-01 13:05 ` Maciej Sobczak
2006-12-01 14:56 ` Matthew Heaney
2006-12-01 19:03 ` Georg Bauhaus
2006-12-01 3:52 ` Matthew Heaney
2006-12-01 4:11 ` Matthew Heaney
2006-12-01 6:12 ` Michael Rohan
2006-12-01 12:40 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox