How to call operator delete with arguments?
It is possible to overload operators new and delete with arguments. E.g.
void* operator new(size_t sz, Pool* pool){/*do something*/};
void operator delete(void* ptr, Pool* pool){/*do something*/}
So to allocate something it is possible to use
Something* sth = new(pool) Something;
But now I want to deallocate sth. How can I pass pool to delete?
Something like
operator delete(sth, pool);
looks too ugly.
PS. It's theoretical question.
void* operator new(size_t sz, Pool* pool){/*do something*/};
void operator delete(void* ptr, Pool* pool){/*do something*/}
So to allocate something it is possible to use
Something* sth = new(pool) Something;
But now I want to deallocate sth. How can I pass pool to delete?
Something like
operator delete(sth, pool);
looks too ugly.
PS. It's theoretical question.
