Placement new operator
Placement new operator
- Subject: Placement new operator
- From: Francis Bouchard <email@hidden>
- Date: Tue, 04 Dec 2001 09:14:37 -0500
Hi, I'm trying to mage a generic class and I would like to use the placement
new operator. Is this allowed ? This would allow me to make a little
template that would take a class that woud do the allocation (using
different IOMalloc method).
Now creating an object would look like this:
void* myPreAllocatedMemory = myAllocator.Allocate(sizeof(CMyCustomClass));
CMyCustomClass* pCustomClass;
pCustomClass = new(myPreAllocatedMemory) CMyCustomClass(initData);
This gives me the error:
too many arguments to function `void * operator new(long unsigned int)'
Francis