Original Post
If I have a class, and I have this in the source file with the ctor and dtors:
static int count = 0; and then in all constructors I put this: count++; printf("count: %d, location: %p\n",count,this); and in destructor: count--; printf("count: %d, location: %p\n",count,this); Then at the end of normal program execution the value in count should always be zero, right? There should never be destructors called for which a constructor was never called. Such is not the case. I end up with count being a negative number and I have it calling the destructor on objects that were never constructed. Could the C++ STL be responsible for this? I have vectors that hold my objects.