Chromium Code Reviews| Index: webrtc/base/bind.h.pump |
| diff --git a/webrtc/base/bind.h.pump b/webrtc/base/bind.h.pump |
| index e1cea61fc2afe85c432daf3f1639c06bbacecebe..b4b1093763e414e2da04bff759afd591c7318be6 100644 |
| --- a/webrtc/base/bind.h.pump |
| +++ b/webrtc/base/bind.h.pump |
| @@ -124,21 +124,26 @@ struct PointerType { |
| T*>::type type; |
| }; |
| -// RemoveScopedPtrRef will capture scoped_refptr by-value instead of |
| -// by-reference. |
| -template <class T> struct RemoveScopedPtrRef { typedef T type; }; |
| +// RemoveAllRef implementations are equivalent to std::remove_reference make |
|
magjed_webrtc
2015/10/23 05:17:01
Missing some word or punctuation between 'std::rem
noahric
2015/10/23 06:02:16
Done (no more comment in template_util.h).
|
| +// sure references and rvalue references are captured by value. |
| template <class T> |
| -struct RemoveScopedPtrRef<const scoped_refptr<T>&> { |
| - typedef scoped_refptr<T> type; |
| +struct RemoveAllRef { |
|
magjed_webrtc
2015/10/23 05:17:01
Can you rename this to rtc::remove_reference and m
noahric
2015/10/23 06:02:16
Done.
|
| + typedef T type; |
| }; |
| +// Remove plain references. |
| template <class T> |
| -struct RemoveScopedPtrRef<scoped_refptr<T>&> { |
| - typedef scoped_refptr<T> type; |
| +struct RemoveAllRef<T&> { |
| + typedef T type; |
| +}; |
| +// Remove rvalue references. |
| +template <class T> |
| +struct RemoveAllRef<T&&> { |
| + typedef T type; |
| }; |
| } // namespace detail |
| -$var n = 6 |
| +$var n = 9 |
| $range i 0..n |
| $for i [[ |
| $range j 1..i |
| @@ -157,7 +162,7 @@ class MethodFunctor$i { |
| MethodT method_; |
| typename detail::PointerType<ObjectT>::type object_;$for j [[ |
| - typename detail::RemoveScopedPtrRef<P$j>::type p$(j)_;]] |
| + typename detail::RemoveAllRef<P$j>::type p$(j)_;]] |
| }; |
| @@ -174,7 +179,7 @@ Functor$i(const FunctorT& functor$for j [[, P$j p$j]]) |
| private: |
| FunctorT functor_;$for j [[ |
| - typename detail::RemoveScopedPtrRef<P$j>::type p$(j)_;]] |
| + typename detail::RemoveAllRef<P$j>::type p$(j)_;]] |
| }; |