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

Unified Diff: base/callback_internal.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: revert unrelated whitespace change 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 | « base/callback.h ('k') | base/memory/raw_scoped_refptr_mismatch_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_internal.h
diff --git a/base/callback_internal.h b/base/callback_internal.h
index 3e8ee82e4f246c5a875ba97d5ae219097e745f19..c28ac0d905c04a7b33490550bd9635e5969a0514 100644
--- a/base/callback_internal.h
+++ b/base/callback_internal.h
@@ -18,7 +18,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/template_util.h"
namespace base {
namespace internal {
@@ -103,7 +102,13 @@ class BASE_EXPORT CallbackBase {
// confuses template deduction in VS2013 with certain types such as
// std::unique_ptr.
// TODO(dcheng): Revisit this when Windows switches to VS2015 by default.
+
template <typename T> struct IsMoveOnlyType {
+ // Types YesType and NoType are guaranteed such that sizeof(YesType) <
+ // sizeof(NoType).
+ using YesType = char;
+ struct NoType { YesType dummy[2]; };
+
template <typename U>
static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
@@ -111,7 +116,7 @@ template <typename T> struct IsMoveOnlyType {
static NoType Test(...);
static const bool value = sizeof((Test<T>(0))) == sizeof(YesType) &&
- !is_const<T>::value;
+ !std::is_const<T>::value;
};
// Specialization of IsMoveOnlyType so that std::unique_ptr is still considered
« no previous file with comments | « base/callback.h ('k') | base/memory/raw_scoped_refptr_mismatch_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698