aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorushiyake <ushiyake@ushiyake-no-MacBook-Pro.local>2017-01-09 21:24:01 +0900
committerushiyake <ushiyake@ushiyake-no-MacBook-Pro.local>2017-01-09 21:24:01 +0900
commitbd2dd4a8e41da76d3b4cd65e79a410c46c1d211d (patch)
tree4549304c34de500c36a586916e8377b0aaeeed0e /include
parent4e39b23e455e455f1878b3e68d729a1737f3e431 (diff)
downloadcrow-bd2dd4a8e41da76d3b4cd65e79a410c46c1d211d.tar.gz
crow-bd2dd4a8e41da76d3b4cd65e79a410c46c1d211d.zip
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 a8aa233..a7995bb 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>