Originally Posted by
matsp
I believe you use a version of placement new, something like:
Code:
sometype *p = new (pool) sometype;
That works only in the non-templated case. If the new operator and MemoryPool::Allocate don't use templates, this works like a charm.
If I use the templated version and call:
Code:
sometype *p = new (pool) sometype;
I get
Code:
error: no matching function for call to 'operator new(long unsigned int, MemoryPool&)'
I've tried:
Code:
sometype *p = new (pool) <sometype> sometype;
//and
sometype *p = new <sometype> (pool) sometype;
//and
sometype *p = <sometype> new (pool) sometype;
None of them compile. Syntax errors for each case.