Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: include/core/SkRefCnt.h

Issue 1771583002: sk_sp: fix contravariant constructors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/RefCntTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRefCnt.h
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 9e8f3be61c33456de32384af7a25f84326d30989..9b05ad49698cb2b6ea15f84e670b24492d0eff9e 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;
« no previous file with comments | « no previous file | tests/RefCntTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698