Hey guys I want to make a destructor counter...So it needs to be outside that specific instance of the class. And i want to keep it hidden. I don't want to be able to access it from outside the class...I Don't want main.cpp to have access to this variable
Foo.hpp
class Foo
{
private:
staticint destructorCount;
public:
~Foo()
{
Foo::destructorCount++;
}
};
Foo.cpp
//Can't initialize static members in the class definition
int Foo::destructorCount = 0;