diff options
author | 2016-03-05 08:30:28 -0800 | |
---|---|---|
committer | 2016-03-05 08:30:28 -0800 | |
commit | ffa39e02bc34a33c23fcccd61b781b5d05a980d3 (patch) | |
tree | 332d51040f0e1d4e26645c5826149ecbfbf9874c /include/core/SkRefCnt.h | |
parent | ec7c0cec3f4d9360ad3d727728ab8b6cbf694e4e (diff) |
sk_sp: fix contravariant constructors
TBR=reed
This is obviously correct and needs to be fixed.
Review URL: https://codereview.chromium.org/1771583002
Diffstat (limited to 'include/core/SkRefCnt.h')
-rw-r--r-- | include/core/SkRefCnt.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 9e8f3be61c..9b05ad4969 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -250,7 +250,7 @@ public: */ sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} template <typename U, - typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>> + typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>> sk_sp(const sk_sp<U>& that) : fPtr(SkSafeRef(that.get())) {} /** @@ -260,7 +260,7 @@ public: */ sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} template <typename U, - typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>> + typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>> sk_sp(sk_sp<U>&& that) : fPtr(that.release()) {} /** @@ -288,7 +288,7 @@ public: return *this; } template <typename U, - typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>> + typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>> sk_sp<T>& operator=(const sk_sp<U>& that) { this->reset(SkSafeRef(that.get())); return *this; @@ -304,7 +304,7 @@ public: return *this; } template <typename U, - typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>> + typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>> sk_sp<T>& operator=(sk_sp<U>&& that) { this->reset(that.release()); return *this; |