How can I determine the number of objects that exist of a specific class?
<p>What is the best way to return the number of existing objects of a class?</p>

<p>For instance, if I have constructed 4 MyClass objects, then the returned value should be 4. My personal use for this is an ID system. I want a class's constructor to assign the next ID number each time a new object of the class is constructed.</p>

<p>Thanks in advance for any guidance!</p>
