The fifth edition of c++ primer describes weak_ptr like this:
A weak_ptr is a smart pointer that does not control the lifetime of the object to which it points.Instead,a weak_ptr points to an object that is managed by a shared_ptr.
But why dot operators are used instead of -> when operations such as reset, use_count, and lock are called? For example:
weak_ptr<int> w(sp);
w.use_count();
w.lock();
Can someone tell me where the problem is?