Write a Session class with static counters for total sessions ever created and sessions currently alive, correct for copies and moves too, and show the counts at several points.
Every way of creating an object – default, copy, move – calls born(), and every destruction decrements alive. At the end, a (moved from but still alive) and the two vector elements remain.
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!
We use Google Analytics cookies to see how LearnFrenzy is used and make it better, and Google AdSense to keep it free.
No analytics or ad cookies are set until you accept. Privacy Policy
·
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!