What’s the difference between raw pointer and weak_ptr?
The fundamental conceptual difference between a naked pointer and a weak_ptr is that if the object pointed to is destroyed, the naked pointer won’t tell you about it. This is called a dangling pointer: a pointer to an object that doesn’t exist. They’re generally hard to track down. The weak_ptr will. In order to use … Read more