Re: [SOLVED] Placement new operator
Re: [SOLVED] Placement new operator
- Subject: Re: [SOLVED] Placement new operator
- From: Francis Bouchard <email@hidden>
- Date: Tue, 04 Dec 2001 11:09:02 -0500
I thought this new was provided by the language... Sorry
I created the missing new operator.
Francis
Francis Bouchard wrote something like :
>
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)'