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

Unified Diff: base/memory/weak_ptr.h

Issue 1774443002: Replace template_util.h stuff with C++11 <type_traits> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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
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);

Powered by Google App Engine
This is Rietveld 408576698