When to use shared_ptr and when to use raw pointers?
Your analysis is quite correct, I think. In this situation, I also would return a bare B*, or even a [const] B& if the object is guaranteed to never be null. Having had some time to peruse smart pointers, I arrived at some guidelines which tell me what to do in many cases: If you … Read more