diff options
Diffstat (limited to 'src/utils/win')
-rw-r--r-- | src/utils/win/SkTScopedComPtr.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/utils/win/SkTScopedComPtr.h b/src/utils/win/SkTScopedComPtr.h index b8aeb73d82..f44740ff44 100644 --- a/src/utils/win/SkTScopedComPtr.h +++ b/src/utils/win/SkTScopedComPtr.h @@ -37,17 +37,20 @@ private: T *fPtr; public: - explicit SkTScopedComPtr(T *ptr = nullptr) : fPtr(ptr) { } + constexpr SkTScopedComPtr() : fPtr(nullptr) {} + constexpr SkTScopedComPtr(std::nullptr_t) : fPtr(nullptr) {} + explicit SkTScopedComPtr(T *ptr) : fPtr(ptr) {} + SkTScopedComPtr(SkTScopedComPtr&& that) : fPtr(that.release()) {} + SkTScopedComPtr(const SkTScopedComPtr&) = delete; ~SkTScopedComPtr() { this->reset();} - SkTScopedComPtr(SkTScopedComPtr&& that) : fPtr(that.release()) {} - SkTScopedComPtr(const SkTScopedComPtr&) = delete; SkTScopedComPtr& operator=(SkTScopedComPtr&& that) { this->reset(that.release()); return *this; } SkTScopedComPtr& operator=(const SkTScopedComPtr&) = delete; + SkTScopedComPtr& operator=(std::nullptr_t) { this->reset(); return *this; } T &operator*() const { SkASSERT(fPtr != nullptr); return *fPtr; } |