Are static members available in new operator for a class?

I have a memory manager class for every class in my project. Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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* operator new(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).
Last edited on
Duh... nevermind. I am used to C#. Forgot the public keyword in front of base class...
Topic archived. No new replies allowed.