As we’ve seen, if we do not initialize a smart pointer, it is initialized as a null pointer. As described in Table 12.3, we can also initialize a smart pointer from a pointer returned by
shared_ptr<double> p1; // shared_ptr that can point at a doubleshared_ptr<int> p2(new int(42)); // p2 points to an int with value 42
The smart pointer constructors that take pointers are
explicit (§ 7.5.4, p. 296). Hence, we cannot implicitly convert a built-in pointer to a smart pointer; we must use the direct form of initialization (§ 3.2.1, p. 84) to initialize ...