Implementation of std::unique_ptr template class in C++