apply shared_ptr