Chromium Code Reviews| Index: base/memory/weak_ptr.h |
| diff --git a/base/memory/weak_ptr.h b/base/memory/weak_ptr.h |
| index 4e50c2776440c5126c31d829efa2983c0d5b8c0d..9b274aca3da9205e4abe91256ef7ebd0bbc04e6d 100644 |
| --- a/base/memory/weak_ptr.h |
| +++ b/base/memory/weak_ptr.h |
| @@ -70,12 +70,13 @@ |
| #ifndef BASE_MEMORY_WEAK_PTR_H_ |
| #define BASE_MEMORY_WEAK_PTR_H_ |
| +#include <type_traits> |
| + |
| #include "base/base_export.h" |
| #include "base/logging.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/sequence_checker.h" |
| -#include "base/template_util.h" |
| namespace base { |
| @@ -160,8 +161,8 @@ class SupportsWeakPtrBase { |
| // function that makes calling this easier. |
| template<typename Derived> |
| static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) { |
| - typedef |
| - is_convertible<Derived, internal::SupportsWeakPtrBase&> convertible; |
| + typedef std::is_convertible<Derived*, internal::SupportsWeakPtrBase*> |
|
danakj
2016/03/08 00:23:35
nit: using instead of typedef
tzik
2016/03/08 13:13:51
Done.
|
| + convertible; |
| static_assert(convertible::value, |
| "AsWeakPtr argument must inherit from SupportsWeakPtr"); |
| return AsWeakPtrImpl<Derived>(t, *t); |