4 Dec
2001
4 Dec
'01
2:14 p.m.
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