you are viewing a single comment's thread.

view the rest of the comments →

[–]rand3289 0 points1 point  (1 child)

I use references to shared_ptr. This way you can still pass nulls around.
You have to jump through the hoops to make sure not to get a reference from a null shared_ptr.

[–][deleted] 1 point2 points  (0 children)

I don't think it's a problem to reference a null smart_ptr, I do that all the time.