Smart-Pointer - Constructors
This article examines constructors that are often overlooked. It examines their use cases and explains why the added functionality is meaningful in relation to smart pointers. Default Constructor Most people remember the default constructor (a zero-argument constructor), but it is sometimes overlooked. The default constructor is useful when the type is used in a context where objects of the type need to be instantiated dynamically by another library (an example is a container resized; when a container is made larger by a resize, new members will need to be constructed, it is the default constructor that will provide these extra instances). ...