Monthly Archives: May 2014

Pointing the Way Redux, Part 6: weak_ptr

shared_ptr was the latest installment in my more info then you ever wanted about which reference to use when series that has also covered values, references, bare pointers, and unique_ptr. This time I’ll be covering the last of the smart pointer trifecta: weak_ptr. Among the smart pointers weak_ptr is sort of the odd one out […]


So far we’ve covered Values, references, bare pointers, and unique_ptr in my more info then you ever wanted about which reference to use when series. Today we’ll move on to shared_ptr. As unique_ptr’s name implies there can be only one unique_ptr pointing at a given object (unless you’re pulling some sort of shenanigans that will […]

Pointing the Way Redux, Part 4: unique_ptr

So far in my series on what reference types to use when we’ve seen values, references and bare pointers. The first makes a strong statement about ownership when used as a return value: returning by value tells the caller that they own the object being returned. The other two are wishy-washy about ownership, but in […]

Pointing The Way Redux, Part 3: Bare Pointers

The next stop in my ongoing series going into too much detail about what type of reference to use when is bare pointers (see motivation and parts 1 and 2). Even though we now have an abundance of smart pointers to choose from – about which I’ll have more to say in future installments – […]