TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
C++ Coding Standard

Rule:  OAL#017Checked automatically with code checker

This rule is Obsolete
Synopsis:Use smart pointers from the standard library
Severity Level:4
Category:Object Allocation


The boost C++ libraries introduced the concept of smart pointers some while ago. The big advantage of smart pointers is that they minimize potential memory leaks. As a result, the boost smart pointers became very popular and thus were adopted by the standard C++ library "std" as well. This rule promotes the use of the "std" variants of smart pointers as opposed to e.g. boost smart pointers because the "std" smart pointers are the standard now.

Incorrect example:

boost::shared_ptr p;

Correct example:

std::shared_ptr p;