summaryrefslogtreecommitdiffstats
path: root/base/bind_internal.h
diff options
context:
space:
mode:
authortzik <tzik@chromium.org>2015-12-17 18:23:26 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 02:25:05 +0000
commit7fe3a687ae2cd98c85e4556441b94e2268704e71 (patch)
tree59eace2ec3170ebbc070430037eb481b514098a4 /base/bind_internal.h
parentc1aac5aad208df58fc0c53af88b6c2ca6ab99bfc (diff)
downloadchromium_src-7fe3a687ae2cd98c85e4556441b94e2268704e71.zip
chromium_src-7fe3a687ae2cd98c85e4556441b94e2268704e71.tar.gz
chromium_src-7fe3a687ae2cd98c85e4556441b94e2268704e71.tar.bz2
Remove unbound base::Bind overload
This CL removes a base::Bind overload without bound arguments. The difference to generic base::Bind is the type check for the bound Runnable: the generic one ensures any argument of the Runnable is not non-const reference, OTHT, the overload being removed checks nothing. Where, comments and tests asserts any *bound* argument should not be non-const reference, so the generic one has been checked excessively. This CL loosen the type check to match the requirement, and then the overloaded base::Bind is no longer needed. BUG= Review URL: https://codereview.chromium.org/1512833002 Cr-Commit-Position: refs/heads/master@{#365988}
Diffstat (limited to 'base/bind_internal.h')
-rw-r--r--base/bind_internal.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/base/bind_internal.h b/base/bind_internal.h
index 49ce0ed..fbf43a0 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -65,17 +65,17 @@ namespace internal {
// |Sig| is a non-const reference.
// Implementation note: This non-specialized case handles zero-arity case only.
// Non-zero-arity cases should be handled by the specialization below.
-template <typename Sig>
-struct HasNonConstReferenceParam : false_type {};
+template <typename List>
+struct HasNonConstReferenceItem : false_type {};
// Implementation note: Select true_type if the first parameter is a non-const
// reference. Otherwise, skip the first parameter and check rest of parameters
// recursively.
-template <typename R, typename T, typename... Args>
-struct HasNonConstReferenceParam<R(T, Args...)>
+template <typename T, typename... Args>
+struct HasNonConstReferenceItem<TypeList<T, Args...>>
: std::conditional<is_non_const_reference<T>::value,
true_type,
- HasNonConstReferenceParam<R(Args...)>>::type {};
+ HasNonConstReferenceItem<TypeList<Args...>>>::type {};
// HasRefCountedTypeAsRawPtr selects true_type when any of the |Args| is a raw
// pointer to a RefCounted type.