In other words, how does the implementation keeps track of the count?
Is there a map-like object maintained which is accessible by all the shared_ptr in
shared_ptr
No. shared_ptr just keep one additional pointer for reference counting.
When you make copy of shared_ptr object it copy pointer with count of references, increase it, and copy pointer on contained object.