aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJaeseung Ha <ipknhama@gmail.com>2017-09-17 14:10:07 +0900
committerGitHub <noreply@github.com>2017-09-17 14:10:07 +0900
commitcf67a40e4c5e6ec0cacbc4ef5ecb063ff6e936e5 (patch)
tree684c8ebf67dee0224b790ed37e2f6da60e0335f1 /include
parent92bea9e949ff9ea9e40ef7ba038cc45cb8490180 (diff)
parentbd2dd4a8e41da76d3b4cd65e79a410c46c1d211d (diff)
downloadcrow-cf67a40e4c5e6ec0cacbc4ef5ecb063ff6e936e5.tar.gz
crow-cf67a40e4c5e6ec0cacbc4ef5ecb063ff6e936e5.zip
Merge pull request #212 from uctakeoff/fix_warning_in_cpp11
Fixed a problem that warning appeared in c ++ 11
Diffstat (limited to 'include')
-rw-r--r--include/crow/routing.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/crow/routing.h b/include/crow/routing.h
index fe65ac4..5d887e4 100644
--- a/include/crow/routing.h
+++ b/include/crow/routing.h
@@ -456,10 +456,16 @@ namespace crow
static_assert(!std::is_same<void, decltype(f(std::declval<Args>()...))>::value,
"Handler function cannot have void return type; valid return types: string, int, crow::resposne, crow::json::wvalue");
- handler_ = [f = std::move(f)](const request&, response& res, Args ... args){
+ handler_ = (
+#ifdef CROW_CAN_USE_CPP14
+ [f = std::move(f)]
+#else
+ [f]
+#endif
+ (const request&, response& res, Args ... args){
res = response(f(args...));
res.end();
- };
+ });
}
template <typename Func>
@@ -475,10 +481,16 @@ namespace crow
static_assert(!std::is_same<void, decltype(f(std::declval<crow::request>(), std::declval<Args>()...))>::value,
"Handler function cannot have void return type; valid return types: string, int, crow::resposne, crow::json::wvalue");
- handler_ = [f = std::move(f)](const crow::request& req, crow::response& res, Args ... args){
+ handler_ = (
+#ifdef CROW_CAN_USE_CPP14
+ [f = std::move(f)]
+#else
+ [f]
+#endif
+ (const crow::request& req, crow::response& res, Args ... args){
res = response(f(req, args...));
res.end();
- };
+ });
}
template <typename Func>