A smart pointer is a datatype simulating a pointer, providing extra features in its implementation.
A smart pointer is in fact very similar to a standard pointer. It is usually wrapped within a class where it can provide additional functionality. One of the features smart pointers can offer is automatic garbage collection. Some smart pointers automatically free the memory associated with it when the destructor is called. This may sometimes involve a reference counter that keep tracks of how many instances of the class point to the same object. This makes smart pointers especially interesting for automatic garbage collection and protection against memory leaks.