Add shared_ptr class implementation (like C++11 version).