Article View: comp.std.c++
Article #1403Re: Overloading operator delete
From: Michael Feathers
Date: Wed, 06 Jan 1993 12:12
Date: Wed, 06 Jan 1993 12:12
37 lines
1987 bytes
1987 bytes
I am the author of this article. I just realized that I did not explain thoroughly. In article <C0Ex9D.Ct7@fiu.edu> feathers@serss0 (Michael Feathers) writes: > >I discovered the hard way a while ago that the operator delete can not be >overloaded in C++. That is, overload operator delete with the placement syntax. We can provide extra versions of operator new with an arbitrary number of additional arguments, but there can be no additional arguments to delete other than those specified in the ARM. I don't have the ARM at home with me right now, so I can not recite chapter and verse. >I've read the annotation in the ARM and I can not say that I agree with >the reasoning. One example given for overloading operator new involves using >another arena for allocation. But how will this memory be deallocated? > >Doesn't the possibility of using the global delete accidently make the >absence of an overloadable delete at least as "hazardous" as allowing it? > >I understand that there are many applications in which programmers may not >be concerned with reclaiming memory, but aren't there enough to justify being >able to use operator delete symmetrically with operator new without resorting >to the work around discussed in the ARM? > >The work around that I've choosen involves using a set of malloc/free type >functions since I have no means of using an overloaded delete symmetrically >with an overloaded new. > >Michael Feathers [feathers@fiu.edu] > > Michael Feathers [feathers@fiu.edu]
Technical Details
Message-ID:
<C0FLxJ.L25@fiu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!max.fiu.edu!serss0!feathersReferences:
<C0Ex9D.Ct7@fiu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!max.fiu.edu!serss0!feathers From: feathers@serss0 (Michael Feathers) Subject: Re: Overloading operator delete Organization: Florida International University, Miami Date: Wed, 6 Jan 1993 12:12:54 GMT Message-ID: <C0FLxJ.L25@fiu.edu> References: <C0Ex9D.Ct7@fiu.edu> Sender: news@fiu.edu (Usenet Administrator) Lines: 39