I defined my pool class(memory pool manage) as a static member in foo class as below but give error error : undefined reference to `foo::mem_' on operator delete.I tried to access mem_ with class foo qualifier but I can't figure it out!.
I should add pool foo::mem_ at the end of my class I means in foo.cpp or foo.h . I ask this becuase befor your answer I add it above my main and it solve the problem.so I want to know if there is any difference or not?
You should put it inside one of your source files because you only want to define it in one translation unit. If you put it's defined in more than one translation unit you will get an error message.