Quick Q: Why is the count of weak_ptr tracked also?
Quick A: To be able to know when to delete the control block.
Recently on SO:
Why shared_ptr's reference counting object needs to keep track of the number of weak_ptrs pointing to the object too?
std::weak_ptrrefers to the control block to know if the object still exists and if so, to provide astd::shared_ptrto it when needed. For that reason, the control block must exist as long as either astd::weak_ptror astd::shared_ptrexists. You need to track the number of instances ofstd::weak_ptrto know when the last one is destroyed, just like forstd::shared_ptr.

Have you registered for CppCon 2017 in September?
Did you try it?
Have you registered for CppCon 2017 in September? 