I am testing a static variable inside of a class. I want it to count the number of instances of the class. Then I want to put my class into an array.
At the creation of my class inside of the array, the count should go up. Then when I destroy an element of the array, the count should go down. I have a destructor that reduces the size of count. If I remove the destructor count goes up fine, but I want the destructor to reduce count. Seems like my destructor is being called when I did not mean for it to.
ok so are you saying that when the resize() function gets called, it is using a copy constructor and the default copy constructor does not use count++ to increase count value? So if I define a copy constructor for resize to use then the problem will be solved?