summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2016-02-19 11:36:56 +0100
committerMurray Cumming <murrayc@murrayc.com>2016-03-01 22:30:50 +0100
commit55d0cb6144288ddafd306a5eefd3c04f4497560c (patch)
tree3e1a8177accabf45e6ead224480990181b3a8a10
parentb1307d2d1760545561e21a458b418258264f6d62 (diff)
downloadsigc++-55d0cb6144288ddafd306a5eefd3c04f4497560c.tar.gz
bind: Some perfect forwarding.
-rw-r--r--sigc++/adaptors/bind.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h
index 980c22e..50de0ee 100644
--- a/sigc++/adaptors/bind.h
+++ b/sigc++/adaptors/bind.h
@@ -168,10 +168,10 @@ struct bind_functor : public adapts<T_functor>
private:
template<class T_specific, class T, std::size_t... Is>
decltype(auto)
- call_functor_operator_parentheses(T& tuple,
+ call_functor_operator_parentheses(T&& tuple,
std::index_sequence<Is...>)
{
- return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(tuple)...);
+ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...);
}
};
@@ -194,12 +194,12 @@ struct bind_functor<-1, T_functor, T_type...> : public adapts<T_functor>
*/
template <class... T_arg>
decltype(auto)
- operator()(T_arg... _A_arg)
+ operator()(T_arg&&... _A_arg)
{
//For instance, if _A_arg has 4 arguments,
//we would want to call operator() with (_A_arg0, _A_arg1, _A_arg2, bound).
- auto t_args = std::tuple<T_arg...>(_A_arg...);
+ auto t_args = std::tuple<T_arg...>(std::forward<T_arg>(_A_arg)...);
auto t_bound = tuple_transform_each<internal::TransformEachInvoker>(bound_);
auto t_with_bound = std::tuple_cat(t_args, t_bound);
@@ -226,10 +226,10 @@ struct bind_functor<-1, T_functor, T_type...> : public adapts<T_functor>
private:
template<class T_specific, class T, std::size_t... Is>
decltype(auto)
- call_functor_operator_parentheses(T& tuple,
+ call_functor_operator_parentheses(T&& tuple,
std::index_sequence<Is...>)
{
- return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(tuple)...);
+ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...);
}
};