diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-19 18:32:14 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-19 18:32:14 +0300 |
commit | b81522b18726d6cac2e91fa8bb79947e58dd4c98 (patch) | |
tree | cf5dabda2d1ea7df71da6653f989c05e47aca7c5 /butl | |
parent | ec76db9e858357686885cd078e39350f66adcc9f (diff) |
Fix GCC warning
Diffstat (limited to 'butl')
-rw-r--r-- | butl/process-run.txx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/butl/process-run.txx b/butl/process-run.txx index 9de601f..1d25af1 100644 --- a/butl/process-run.txx +++ b/butl/process-run.txx @@ -28,6 +28,14 @@ namespace butl int out, int err); + template <typename V, typename T> + inline const char* + process_args_as_wrapper (V& v, const T& x, std::string& storage) + { + process_args_as (v, x, storage); + return nullptr; + } + template <typename C, typename I, typename O, @@ -58,14 +66,10 @@ namespace butl small_vector<const char*, args_size + 2> cmd; cmd.push_back (pp.recall_string ()); - auto call = [&cmd] (const auto& x, std::string& s) -> const char* - { - process_args_as (cmd, x, s); - return nullptr; - }; - std::string storage[args_size != 0 ? args_size : 1]; - const char* dummy[] = {nullptr, call (args, storage[index])... }; + + const char* dummy[] = { + nullptr, process_args_as_wrapper (cmd, args, storage[index])... }; cmd.push_back (dummy[0]); // NULL (and get rid of unused warning). |