Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Commit ce29703

Browse files
committed
ensure compatibility for client_kill for g++ 4.8
1 parent d6a3473 commit ce29703

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

includes/cpp_redis/future_client.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class future_client {
9494
future brpop(const std::vector<std::string>& keys, int timeout);
9595
future brpoplpush(const std::string& src, const std::string& dst, int timeout);
9696
template <typename T, typename... Ts>
97-
future client_kill(const T&, const Ts&...);
97+
future client_kill(const T, const Ts...);
9898
future client_list();
9999
future client_getname();
100100
future client_pause(int timeout);
@@ -309,8 +309,15 @@ class future_client {
309309

310310
template <typename T, typename... Ts>
311311
future_client::future
312-
future_client::client_kill(const T& arg, const Ts&... args) {
313-
return exec_cmd([=](const rcb_t& cb) -> rc& { return m_client.client_kill(arg, args..., cb); });
312+
future_client::client_kill(const T arg, const Ts... args) {
313+
314+
/** gcc 4.8 doesn't handle variadic template capture arguments (appears in 4.9), so std::bind should capture all arguments
315+
* because of the compiler.
316+
*/
317+
return exec_cmd(std::bind([this](T arg, Ts... args, const rcb_t& cb) -> rc& {
318+
return m_client.client_kill(arg, args..., cb);
319+
},
320+
arg, args..., std::placeholders::_1));
314321
}
315322

316323
} //! cpp_redis

0 commit comments

Comments
 (0)