ControlBlock member of weak_ptr

47 Views Asked by At

So I've been reading about shared_ptr/weak_ptr implementation and I do not get a small detail. As far as I understand, there is a class ControlBlock defined in the private section of shared_ptr. But weak_ptr also stores a pointer to some ControlBlock instance. In my implementation should I befriend weak_ptr inside shared_ptr or define ControlBlock outside shared_ptr as a struct?

0

There are 0 best solutions below