From 8311524935932a3b33c4fbd14012094d4138bf1e Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 20 May 2019 16:55:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84checkArgs=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index e3cd1c99..31df7ae2 100644 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -176,17 +176,17 @@ static inline void addHttpListener(){ } template -bool checArgs(Args &&args,First &&first){ +bool checkArgs(Args &&args,First &&first){ return !args[first].empty(); } template -bool checArgs(Args &&args,First &&first,KeyTypes && ...keys){ - return !args[first].empty() && checArgs(args,keys...); +bool checkArgs(Args &&args,First &&first,KeyTypes && ...keys){ + return !args[first].empty() && checkArgs(std::forward(args),std::forward(keys)...); } #define CHECK_ARGS(...) \ - if(!checArgs(allArgs,##__VA_ARGS__)){ \ + if(!checkArgs(allArgs,##__VA_ARGS__)){ \ throw InvalidArgs("缺少必要参数:" #__VA_ARGS__); \ }