Monthly Archives: December 2013

Pointing the Way

While doing a code review the other day I came across something like this (names have been changed to protect the proprietary) class Foo { private: Bar m_bar; public: std::shared_ptr<Bar> GetBar() const { return std::make_shared<Bar>(m_bar); } }; Needless to say the code in question did not pass review. Between the unescessary copying of m_bar and […]