I'm trying to define a class which can be passed an "object allocator" function and takes the template object's operator new() as the default argument. I have the following code:
template<class _Obj>
class Foo
{
private:
typedef _Obj (_Obj::*fp_alloc_type)();
public:
Foo(fp_alloc_type t=_Obj::operator new ());
...
};
This gives a comiler error C2039: 'new' : is not a member of 'SomeObj'
Does the compiler not generate a default implementation of 'new' for objects which do not define their own? Am I missing something?