I have another suggestion about memory management of ISO C++. I think
it is very IMPORTANT. And I hope it can be discussed in C++0x.
----
A proposal to cancel overriding the DEFAULT operator new/delete
I don't think we need to override the DEFAULT operator new/delete.
This makes your code doesn't work well together 3rdparty code (if it
also override them).
I suggest ISO C++ cancel this feature, just like we can't override
operator+ of all C types. That is:
1. You CAN NOT override these operators:
void* operator new(size_t size);
void operator delete(void* p);
2. You CAN override NON-DEFAULT operator new. Such as:
void* operator new(size_t size, my_allocator& alloc);
3. There is no need to override operator delete. If you need delete
objects in special way, just use:
alloc.destroy(obj);
That's all.
Thanks.
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]