Topic: but there are holes
Author: Marcus Barnes <marcus_aurelius@my-deja.com>
Date: 2000/07/28 Raw View
In article <B5A49DD7.8225%anders@milkweed.com>,
Anders Pytte <anders@milkweed.com> wrote:
>
> I think the purpose of operator new and delete is to manage
> the raw storage.
Both operator new and delete are class static methods. Look at what the
compiler must do to *try* and insure that the "matching" delete is
called. Because these methods aren't object based, operator delete
cannot be virtual.
To compound the issues, the scope operator can be used to redirect
calls to global new and delete. Name another class scope operator that
can be circumvented like this?
I often see direct useage of new and delete deprecated in favor of class
factories and destroy() or unref() type methods. The native language
mechanisms don't seem to support the degree of coherency that's needed
by complex class hierarchies.
--
Regards, Marcus
Sent via Deja.com http://www.deja.com/
Before you buy.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]