Is it possible to create a pointer to the `new` operator / constructor function?

If I wanted to parameterize the creation of an object, I could, of course, create a function that called new in a particular class and passed a pointer. I am wondering if it is possible to skip this step and pass the function pointer to the operator itself new.

+5
source share
2 answers

boost :: lambda provides function wrappers for newand delete. They can be used to easily transform a call newinto a function object.

+9
source

operator new ( ) , . void*. , , , . , ; , return.

+2

All Articles