mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
commit
120e1f3ad2
@ -79,12 +79,16 @@ namespace crow
|
|||||||
return router_.new_rule_dynamic(std::move(rule));
|
return router_.new_rule_dynamic(std::move(rule));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a route using a rule (**Use CROW_ROUTE instead**)
|
///Create a route using a rule (**Use CROW_ROUTE instead**)
|
||||||
template<uint64_t Tag>
|
template<uint64_t Tag>
|
||||||
auto route(std::string&& rule)
|
#ifdef CROW_GCC83_WORKAROUND
|
||||||
#ifdef CROW_CAN_USE_CPP17
|
auto& route(std::string&& rule)
|
||||||
-> typename std::invoke_result<decltype(&Router::new_rule_tagged<Tag>), Router, std::string&&>::type
|
|
||||||
#else
|
#else
|
||||||
|
auto route(std::string&& rule)
|
||||||
|
#endif
|
||||||
|
#if defined CROW_CAN_USE_CPP17 && !defined CROW_GCC83_WORKAROUND
|
||||||
|
-> typename std::invoke_result<decltype(&Router::new_rule_tagged<Tag>), Router, std::string&&>::type
|
||||||
|
#elif !defined CROW_GCC83_WORKAROUND
|
||||||
-> typename std::result_of<decltype (&Router::new_rule_tagged<Tag>)(Router, std::string&&)>::type
|
-> typename std::result_of<decltype (&Router::new_rule_tagged<Tag>)(Router, std::string&&)>::type
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -57,3 +57,11 @@
|
|||||||
#define noexcept throw()
|
#define noexcept throw()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ < 4
|
||||||
|
#if __cplusplus > 201103L
|
||||||
|
#define CROW_GCC83_WORKAROUND
|
||||||
|
#else
|
||||||
|
#error "GCC 8.1 - 8.3 has a bug that prevents crow from compiling with C++11. Please update GCC to > 8.3 or use C++ > 11."
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user