How to return smart pointers and covariance in C++ I am following this tutorial to understand how to return smart pointers and covariance in C++.