Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!odi!dlw From: dlw@odi.com (Dan Weinreb) Newsgroups: comp.lang.c++ Subject: Re: Overloaded operator new Message-ID: <1990Dec5.165127.16476@odi.com> Date: 5 Dec 90 16:51:27 GMT References: <1990Dec4.062015.6637@sjsumcs.sjsu.edu> Reply-To: dlw@odi.com Organization: Object Design, Inc. Lines: 18 In-Reply-To: cline@cheetah.ece.clarkson.edu's message of 4 Dec 90 16:13:52 GMT In article cline@cheetah.ece.clarkson.edu (Marshall Cline) writes: The problem with all this is that the *client* must remember where the object came from, and delete has only one syntax. The ARM (p.65-6) discusses the possibility of having a matching placement deletion syntax, but argues that it requires the client to remember all this stuff, so that the client has to choose the right deletion routine. This is all true. However, sometimes you have an object in which you want to control how it is allocated (e.g. you want it to live in special shared virtual memory or something like that), for all instances of the class. So all instances are always allocated the same way, and so you can just write one operator delete that does the appropriate deletion. The parameterization of operator new is still useful. This is only a special case, of course; in general you'd like to be able to allocate some objects one way and some another way, and not have the problem with delete. But it is a useful special case. Brought to you by Super Global Mega Corp .com