to use shared_ptr