|
|
@@ -33,7 +33,7 @@ public:
|
|
|
cli(std::istream &in = std::cin);
|
|
|
template <typename... Args>
|
|
|
cli & register_callback(std::string const & handle,
|
|
|
- std::function<void(Args...)> const & cb);
|
|
|
+ std::function<void(Args...)> cb);
|
|
|
template <typename F>
|
|
|
cli & register_callback(std::string const & handle, F && cb) {
|
|
|
return register_callback(handle, lambdas::FFL(cb));
|
|
|
@@ -51,7 +51,7 @@ void cli_invoke(std::function<void(Args...)> cb, cli::args_t const & args,
|
|
|
|
|
|
template <typename... Args>
|
|
|
cli & cli::register_callback(std::string const & handle,
|
|
|
- std::function<void(Args...)> const & cb) {
|
|
|
+ std::function<void(Args...)> cb) {
|
|
|
callbacks_.emplace(handle, [cb](args_t const & args) {
|
|
|
if (sizeof...(Args) > args.size()) return; // TODO: Error message
|
|
|
cli_invoke(cb, args, std::make_index_sequence<sizeof...(Args)>());
|