[libsigc++2/variadic_mem_fun2] hide_functor: Don't specify a specific specialization for operator().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigc++2/variadic_mem_fun2] hide_functor: Don't specify a specific specialization for operator().
- Date: Sat, 5 Mar 2016 22:20:29 +0000 (UTC)
commit b74253a1ff9fd60b2caa3017cf6c49af29f09226
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Mar 5 23:18:41 2016 +0100
hide_functor: Don't specify a specific specialization for operator().
It doesn't seem to be necessary now.
sigc++/adaptors/hide.h | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h
index e6b186a..443eb9f 100644
--- a/sigc++/adaptors/hide.h
+++ b/sigc++/adaptors/hide.h
@@ -87,22 +87,13 @@ struct hide_functor : public adapts<T_functor>
const auto t_end = internal::tuple_end<size - index_ignore - 1>(t);
auto t_used = std::tuple_cat(t_start, t_end); //TODO: Let this be const?
- //This is so we can specify a particular instantiation of the functor's
- //operator().
- //TODO: Avoid this if it no longer necessary.
- using t_type = std::tuple<type_trait_pass_t<T_arg>...>;
- using t_type_start = typename internal::tuple_type_start<t_type, index_ignore>::type;
- using t_type_end = typename internal::tuple_type_end<t_type, size - index_ignore - 1>::type;
- using t_type_used = typename internal::tuple_type_cat<t_type_start, t_type_end>::type;
-
constexpr auto size_used = size - 1;
//TODO: Remove these? They are just here as a sanity check.
- static_assert(std::tuple_size<t_type_used>::value == size_used, "Unexpected t_type_used size.");
static_assert(std::tuple_size<decltype(t_used)>::value == size_used, "Unexpected t_used size.");
const auto seq = std::make_index_sequence<size_used>();
- return call_functor_operator_parentheses<t_type_used>(t_used, seq);
+ return call_functor_operator_parentheses(t_used, seq);
}
/** Constructs a hide_functor object that adds a dummy parameter to the passed functor.
@@ -115,12 +106,12 @@ struct hide_functor : public adapts<T_functor>
private:
//TODO_variadic: Replace this with std::experimental::apply() if that becomes standard
//C++, or add our own implementation, to avoid code duplication.
- template<class T_tuple_specific, class T_tuple, std::size_t... Is>
+ template<class T_tuple, std::size_t... Is>
decltype(auto)
call_functor_operator_parentheses(T_tuple& tuple,
std::index_sequence<Is...>)
{
- return this->functor_.template operator()<typename std::tuple_element<Is,
T_tuple_specific>::type...>(std::get<Is>(tuple)...);
+ return this->functor_.template operator()(std::get<Is>(tuple)...);
}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]