What is an in-place constructor in C++? [duplicate]
This is called the placement new operator. It allows you to supply the memory the data will be allocated in without having the new operator allocate it. For example: Foo * f = new Foo(); The above will allocate memory for you. void * fm = malloc(sizeof(Foo)); Foo *f = new (fm) Foo(); The above … Read more