Skip to main content

Practice · 1 of 3

Count every instance

CHALLENGE
Difficulty: intermediate+25 XP

Implement class Tracked with an inline static int live_; and inline static int created_;. The constructor increments both; the destructor decrements live_. Provide static getters int live() and int created().

Back to lesson: Practice: static members and this