Path: utzoo!utgpu!watserv1!watmath!att!hriso!attdso!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: operator delete -- static AND virtual ???? Summary: Static, types, and typelessness Message-ID: <416@mole-end.UUCP> Date: 1 Jun 90 03:56:41 GMT References: <401@mole-end.UUCP> <29839@cup.portal.com> <413@mole-end.UUCP> <30161@cup.portal.com> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 35 > > when I write > > delete xp; > > I am invoking a delete operator. > Aha, here's part of the problem. There is a difference between the delete > operator and operator delete(). The definition of the delete operator is > that it invokes the destructor, if any, and then invokes operator delete(). This distinction and this ordering don't seem to be well spelled out in the Reference Manual; thank you for explaining them. . . . > > The exact words of the reference manual are that operator delete is static. > In some sense, calling operator delete() "static" is arbitrary and a bit > misleading; the only thing operator delete() has in common with static member > functions is the absence of a "this" pointer. The main idea of static member > functions is that they can be invoked ... i.e., without referring to a > particular object, but that makes no sense for operator delete(): it has to > be accessed via an object, although the object will have been destroyed > before operator delete() gets control. I think X3J16 may want to visit > this issue of terminology as well. Is the `object' really an object by the time operator delete() gets at it? An object is a region of memory with a type, and the type is stripped when the object is destroyed. All that's left by the invocation of operator delete() is a typeless region of memory. In an Aristotelian sense, it's no longer a `thing,' it's just `stuff.' I agree that the terminology would benefit from clarification. -- (This man's opinions are his own.) From mole-end Mark Terribile