Resets the RefPtr from a pointer. This is an ownership transfer operation, and the caller has to own a valid reference to ptr (unless ptr is nullptr).
| 83 | // Resets the RefPtr from a pointer. This is an ownership transfer operation, |
| 84 | // and the caller has to own a valid reference to ptr (unless ptr is nullptr). |
| 85 | void reset(T* ptr = nullptr) { |
| 86 | Release(ptr_); |
| 87 | ptr_ = ptr; |
| 88 | } |
| 89 | |
| 90 | private: |
| 91 | static void Release(T* ptr) { |
no outgoing calls