2 ms·
Why not? In fact shared_ptr even has an aliasing constructor that allows you to refer an pointer whose lifetime is tied to an unrelated shared_ptr. Of course t
by kccqzy 7y ago
Why not? In fact shared_ptr even has an aliasing constructor that allows you to refer an pointer whose lifetime is tied to an unrelated shared_ptr.
Of course the only sane use case is that that unrelated shared_ptr will definitely outlive that other pointer. But you get the idea, shared_ptr is incredibly flexible.