class MyClass
{
private:
class Allocator : BaseAllocator
{
public:
Allocator();
// base class has a public member function:
// void* createObjectRef();
// the size doesn't need to be passed because
// it has already been determined
};
static MyClass::Allocator _allocator;
public:
void* operatornew(size_t t)
{
return _allocator.createObjectRef();
}
};
The purpose of the allocator is to work with the application's object manager to manage memory (and a memory pool) and the handle creation of new instances of the particular class. However, when I override the new operator for MyClass, it says that the createObjectRef() function is inaccessible (the function is actually in a cpp file and not the header).