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

Unified Diff: base/bind_internal.h

Issue 1457673002: styleguide: Allow enable_if, conditional, and other type_traits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rare usage note Created 5 years, 1 month 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 | base/callback_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_internal.h
diff --git a/base/bind_internal.h b/base/bind_internal.h
index e05321886223f8863693aba9e910408dc463696e..1cb1684d7259f42c6cb1d937e3b2ab6fc5eee406 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -5,6 +5,8 @@
#ifndef BASE_BIND_INTERNAL_H_
#define BASE_BIND_INTERNAL_H_
+#include <type_traits>
+
#include "base/bind_helpers.h"
#include "base/callback_internal.h"
#include "base/memory/raw_scoped_refptr_mismatch_checker.h"
@@ -77,9 +79,9 @@ struct HasNonConstReferenceParam : false_type {};
// recursively.
template <typename R, typename T, typename... Args>
struct HasNonConstReferenceParam<R(T, Args...)>
- : SelectType<is_non_const_reference<T>::value,
- true_type,
- HasNonConstReferenceParam<R(Args...)>>::Type {};
+ : std::conditional<is_non_const_reference<T>::value,
+ true_type,
+ HasNonConstReferenceParam<R(Args...)>>::type {};
// HasRefCountedTypeAsRawPtr selects true_type when any of the |Args| is a raw
// pointer to a RefCounted type.
@@ -93,9 +95,9 @@ struct HasRefCountedTypeAsRawPtr : false_type {};
// parameters recursively.
template <typename T, typename... Args>
struct HasRefCountedTypeAsRawPtr<T, Args...>
- : SelectType<NeedsScopedRefptrButGetsRawPtr<T>::value,
- true_type,
- HasRefCountedTypeAsRawPtr<Args...>>::Type {};
+ : std::conditional<NeedsScopedRefptrButGetsRawPtr<T>::value,
+ true_type,
+ HasRefCountedTypeAsRawPtr<Args...>>::type {};
// BindsArrayToFirstArg selects true_type when |is_method| is true and the first
// item of |Args| is an array type.
« no previous file with comments | « no previous file | base/callback_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698