mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Fixed a problem that warning appeared in c ++ 11
This commit is contained in:
parent
4e39b23e45
commit
bd2dd4a8e4
@ -456,10 +456,16 @@ namespace crow
|
|||||||
static_assert(!std::is_same<void, decltype(f(std::declval<Args>()...))>::value,
|
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 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 = response(f(args...));
|
||||||
res.end();
|
res.end();
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Func>
|
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,
|
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 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 = response(f(req, args...));
|
||||||
res.end();
|
res.end();
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Func>
|
template <typename Func>
|
||||||
|
Loading…
Reference in New Issue
Block a user