[libsigc++2/variadic_bind4: 16/18] bind_functor::operator(): Do perfect forwarding.



commit 28e09b1aed9a20b9e9a4e308a41e31541c321d86
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 2 13:36:30 2016 +0100

    bind_functor::operator(): Do perfect forwarding.
    
    To be consistent with the other operator().

 sigc++/adaptors/bind.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h
index 5816c19..6458a7d 100644
--- a/sigc++/adaptors/bind.h
+++ b/sigc++/adaptors/bind.h
@@ -127,13 +127,13 @@ struct bind_functor : public adapts<T_functor>
    */
   template <class... T_arg>
   decltype(auto)
-  operator()(T_arg... _A_arg)
+  operator()(T_arg&&... _A_arg)
     {
       //For instance, if I_location is 1, and _A_arg has 4 arguments,
       //we would want to call operator() with (_A_arg0, bound, _A_arg1, _A_arg2).
       
       using tuple_type_args = std::tuple<type_trait_pass_t<T_arg>...>;
-      auto t_args = std::tuple<T_arg...>(_A_arg...);
+      auto t_args = std::tuple<T_arg...>(std::forward<T_arg>(_A_arg)...);
       constexpr auto t_args_size = std::tuple_size<tuple_type_args>::value;
       
       auto t_start = tuple_start<I_location>(t_args);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]