Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 4
    The beginning of your answer sounds promising, but could you elaborate? Commented Dec 29, 2010 at 17:54
  • 12
    @IIyan, the semantics in his code is "print how many times 'foo' was called!". From what one can see in his question, this has nothing to do with state of the class, and so it would be plain wrong to put the variable as a static class member. If however foo would be a copy constructor and bar would be called numberOfCopies, it would be a good candidate for a static class member. So it depends on how it's used. Commented Dec 29, 2010 at 17:55