Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!umich!itivax!scs From: scs@itivax.UUCP (Steve C. Simmons) Newsgroups: comp.lang.c++ Subject: Re: Overloading operator new() Summary: garbage collection, exception processing Message-ID: <294@itivax.UUCP> Date: 6 Oct 88 13:59:57 GMT References: <5949@june.cs.washington.edu> Reply-To: scs@itivax.UUCP (Steve C. Simmons) Organization: Industrial Technology Institute, Ann Arbor Lines: 16 In article <5949@june.cs.washington.edu> david@uw-june.UUCP (David Callahan) writes: >Could someone show me an example of "new" being overloaded and how >it would be used? Someone else has already posted how to do it. I have no examples, but can think of a good reason to do it -- exception handling. Since new allocates memory, there must be a way of doing garbage collection should that allocation become unneeded due to an exception. By overloading new, you can go a long way to providing your own garbage collection software and make use of more c-style exception processing. Not perfect, but a good step. -- Steve Simmons ...!umix!itivax!scs Industrial Technology Institute, Ann Arbor, MI. "You can't get here from here."