Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!claris!hearn From: hearn@claris.com (Bob Hearn) Newsgroups: comp.lang.c++ Subject: Re: Free store overloading Message-ID: <9731@claris.com> Date: 10 Apr 89 18:16:18 GMT References: <3439@nunki.usc.edu> Organization: Claris Corporation, Mountain View CA Lines: 24 From article <3439@nunki.usc.edu>, by jeenglis@nunki.usc.edu (Joe English): > > Wouldn't it make sense to be able to overload operators new > and delete for class objects than to have to assign to > 'this' in the constructors and destructor? Also, if > operator delete could be overloaded, it would obviate the > need in the destructor to find out if the object was > dynamically or statically allocated. A recent language extension allows overloading of new and delete. New takes a long arg specifying size (since derived classes may be larger). Overloading new and delete is different from other overloading in that applications of new to types which don't have new overloaded always use the global new, regardless of scope. But this is only natural; from a programmer's point of view new is not really an operator anyway, it is a language construct. Other recent extensions include multiple inheritance, pointers to member functions, protected members, and overloading the -> operator. I don't know which, if any, of these extensions the Zortech compiler implements. For more info, see "The Evolution of C++: 1985 to 1987," if you can find it anywhere. Bob Hearn hearn@claris.com