Imagine I'm in C-land, and I have
void* my_alloc(size_t size);
void* my_free(void*);
then I can go through my code and replace all calls to malloc/free with my_alloc/my_free.
How, I know that given a class Foo, I can do placement new; I can also overload the new operator. However, is there a way to do this for all my C++ classes? (i.e. I want to use my own allocator for new and new[]; but I don't want to run through and hack every class I have defined.)
Thanks!