migrate from std::auto_ptr to std::unique_ptr