Wow - I didn't realise that make_shared can implement an intrusive shared pointer. I guess it doesn't have to, according to the standard, but it makes sense as an optimisation.
I usually use weak_ptrs to break cycles in object graphs - and this still works, because the weak_ptrs will be destroyed during the object destructor, meaning the memory deallocation will still happen, just not necessarily at the same time as the destructor is called.
What other uses do people use weak_ptrs for?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.