From ee5fd90770c2469c4ed1a9a3506eddad8f33f181 Mon Sep 17 00:00:00 2001 From: qicosmos Date: Thu, 21 Apr 2022 03:34:47 +0000 Subject: [PATCH] remove some --- include/rest_rpc/rpc_client.hpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/include/rest_rpc/rpc_client.hpp b/include/rest_rpc/rpc_client.hpp index b0563f2..75a4d4a 100644 --- a/include/rest_rpc/rpc_client.hpp +++ b/include/rest_rpc/rpc_client.hpp @@ -202,29 +202,6 @@ public: bool has_connected() const { return has_connected_; } // sync call -#if __cplusplus > 201402L - template - auto call(const std::string &rpc_name, Args &&...args) { - std::future future = - async_call(rpc_name, std::forward(args)...); - auto status = future.wait_for(std::chrono::milliseconds(TIMEOUT)); - if (status == std::future_status::timeout || - status == std::future_status::deferred) { - throw std::out_of_range("timeout or deferred"); - } - - if constexpr (std::is_void_v) { - future.get().as(); - } else { - return future.get().template as(); - } - } - - template - auto call(const std::string &rpc_name, Args &&...args) { - return call(rpc_name, std::forward(args)...); - } -#else template typename std::enable_if::value>::type call(const std::string &rpc_name, Args &&...args) { @@ -272,7 +249,6 @@ public: call(const std::string &rpc_name, Args &&...args) { return call(rpc_name, std::forward(args)...); } -#endif template future_result async_call(const std::string &rpc_name,