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

Unified Diff: third_party/WebKit/Source/wtf/TypeTraits.h

Issue 2220443004: Use std::is_convertible in EnsurePtrConvertibleArgDecl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: w/ ifdef, w/ test Created 4 years, 3 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 | third_party/WebKit/Source/wtf/TypeTraitsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/TypeTraits.h
diff --git a/third_party/WebKit/Source/wtf/TypeTraits.h b/third_party/WebKit/Source/wtf/TypeTraits.h
index c5199c173c2c4d6b9286d2ee525480ff9e326986..7449fdadfaffe4630679ce6dfc99e08637213826 100644
--- a/third_party/WebKit/Source/wtf/TypeTraits.h
+++ b/third_party/WebKit/Source/wtf/TypeTraits.h
@@ -218,23 +218,23 @@ struct RemoveTemplate<OuterTemplate<T>, OuterTemplate> {
// Here, we use a template specialization for same type case to allow incomplete
// types.
-template <typename T, typename U> struct IsBaseOf {
- static const bool value = std::is_base_of<T, U>::value;
+template <typename T, typename U> struct IsConvertible {
+ static const bool value = std::is_convertible<T, U>::value;
};
-template <typename T> struct IsBaseOf<T, T> {
+template <typename T> struct IsConvertible<T, T> {
static const bool value = true;
};
#define EnsurePtrConvertibleArgDecl(From, To) \
- typename std::enable_if<WTF::IsBaseOf<To, From>::value>::type* = nullptr
+ typename std::enable_if<WTF::IsConvertible<From*, To*>::value>::type* = nullptr
#define EnsurePtrConvertibleArgDefn(From, To) \
- typename std::enable_if<WTF::IsBaseOf<To, From>::value>::type*
+ typename std::enable_if<WTF::IsConvertible<From*, To*>::value>::type*
#else
#define EnsurePtrConvertibleArgDecl(From, To) \
- typename std::enable_if<std::is_base_of<To, From>::value>::type* = nullptr
+ typename std::enable_if<std::is_convertible<From*, To*>::value>::type* = nullptr
#define EnsurePtrConvertibleArgDefn(From, To) \
- typename std::enable_if<std::is_base_of<To, From>::value>::type*
+ typename std::enable_if<std::is_convertible<From*, To*>::value>::type*
#endif
} // namespace WTF
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/TypeTraitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698