Do not prefer to use shared_ptr unless needed. Prefer using C++ references and unique_ptr instead. shared_ptr is a performance hog and makes the code look more complex than it is. Normally this won't be an issue, except for the unusual attractiveness of shared_ptr and its contagious nature.