libcc1: use variadic templates for callbacks
This patch completes the transition of libcc1 from the use of separate template functions for different arities to the use of variadic functions. This is how I had wanted it to work from the very beginning, and is possible now with C++11. I had thought that variadic callbacks required C++17, but it turns out that the approach taken here is basically equivalent to std::apply -- just a bit wordier. libcc1 * rpc.hh (argument_wrapper) <get>: Replace cast operator. (argument_wrapper<T *>) <get>: Likewise. (unmarshall): Add std::tuple overloads. (callback): Remove. (class invoker): New. * libcp1plugin.cc (plugin_init): Update. * libcp1.cc (libcp1::add_callbacks): Update. * libcc1plugin.cc (plugin_init): Update. * libcc1.cc (libcc1::add_callbacks): Update. * connection.cc (cc1_plugin::connection::do_wait): Update.
Showing
- libcc1/connection.cc 1 addition, 1 deletionlibcc1/connection.cc
- libcc1/libcc1.cc 5 additions, 7 deletionslibcc1/libcc1.cc
- libcc1/libcc1plugin.cc 10 additions, 10 deletionslibcc1/libcc1plugin.cc
- libcc1/libcp1.cc 6 additions, 11 deletionslibcc1/libcp1.cc
- libcc1/libcp1plugin.cc 10 additions, 10 deletionslibcc1/libcp1plugin.cc
- libcc1/rpc.hh 56 additions, 163 deletionslibcc1/rpc.hh
Loading
Please register or sign in to comment