Chromium Code Reviews| Index: base/bind_internal.h |
| diff --git a/base/bind_internal.h b/base/bind_internal.h |
| index c6832e6a479ed3da0a386855327de207e6fedca6..d8d5ee6c2d1e608228a8b8fdd37385fca155d2db 100644 |
| --- a/base/bind_internal.h |
| +++ b/base/bind_internal.h |
| @@ -71,17 +71,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...)> |
|
dcheng
2015/12/14 19:26:46
I have a dumb question: why can't we just add a te
tzik
2015/12/15 05:55:09
Add specialization for R() and remove the base cas
|
| +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. |