diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-09-21 09:18:03 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-09-21 09:18:03 +0200 |
commit | e497c86718bd2d158372ab59721e79032c84eb0d (patch) | |
tree | 3f179a5e5333e9e359a85cfd8f9e283f8113b9fc /sigc++/signal.h | |
parent | 9bbb94d5c9b7f7dfa7e2ae80bdef2e45bdb3ce1a (diff) | |
download | sigc++-c++17v4.tar.gz |
C++17: Replace call_*() helpers with std::apply().c++17v4
Diffstat (limited to 'sigc++/signal.h')
-rw-r--r-- | sigc++/signal.h | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sigc++/signal.h b/sigc++/signal.h index e6a6090..6b26cac 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -246,8 +246,7 @@ struct signal_emit */ T_return operator()(const slot_type& slot) const { - const auto seq = std::make_index_sequence<std::tuple_size<decltype(a_)>::value>(); - return call_call_type_operator_parentheses_with_tuple(slot, a_, seq); + return std::apply(slot, a_); } /** Executes a list of slots using an accumulator of type @e T_accumulator. @@ -274,15 +273,6 @@ struct signal_emit private: std::tuple<type_trait_take_t<T_arg>...> a_; - - // TODO_variadic: Replace this with std::experimental::apply() if that becomes standard - // C++, or add our own implementation, to avoid code duplication. - template <std::size_t... Is> - decltype(auto) call_call_type_operator_parentheses_with_tuple( - const slot_type& slot, const std::tuple<T_arg...>& tuple, std::index_sequence<Is...>) const - { - return std::invoke(slot, std::get<Is>(tuple)...); - } }; /** Abstracts signal emission. |