Index: include/core/SkRefCnt.h |
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h |
index abe3fb28278206147693753a5137c40f36e0a4f3..0e8d857722d2678d8620fe923267fff82b7e197e 100644 |
--- a/include/core/SkRefCnt.h |
+++ b/include/core/SkRefCnt.h |
@@ -9,8 +9,8 @@ |
#define SkRefCnt_DEFINED |
#include "../private/SkAtomics.h" |
+#include "../private/SkUniquePtr.h" |
#include "SkTypes.h" |
-#include <memory> |
/** \class SkRefCntBase |
@@ -185,15 +185,12 @@ |
/** |
* Utility class that simply unref's its argument in the destructor. |
*/ |
-template <typename T> class SkAutoTUnref : public std::unique_ptr<T, SkTUnref<T>> { |
-public: |
- explicit SkAutoTUnref(T* obj = nullptr) : std::unique_ptr<T, SkTUnref<T>>(obj) {} |
+template <typename T> class SkAutoTUnref : public skstd::unique_ptr<T, SkTUnref<T>> { |
+public: |
+ explicit SkAutoTUnref(T* obj = nullptr) : skstd::unique_ptr<T, SkTUnref<T>>(obj) {} |
T* detach() { return this->release(); } |
operator T*() const { return this->get(); } |
- |
- // unique_ptr's operator bool() is not always be explicit on Android. Make sure this is. |
- explicit operator bool() const { return this->get() != nullptr; } |
}; |
// Can't use the #define trick below to guard a bare SkAutoTUnref(...) because it's templated. :( |