GCC 8 workaround

This commit is contained in:
Florian Rupprecht 2021-11-23 16:00:14 +01:00
parent e87ec70179
commit 7a0576546c
2 changed files with 8 additions and 0 deletions

View File

@ -82,6 +82,9 @@ namespace crow
///Create a route using a rule (**Use CROW_ROUTE instead**)
template <uint64_t Tag>
#ifdef CROW_GCC8_WORKAROUND
auto& route(std::string&& rule)
#else
auto route(std::string&& rule)
#ifdef CROW_CAN_USE_CPP17
-> typename std::invoke_result<decltype(&Router::new_rule_tagged<Tag>),
@ -89,6 +92,7 @@ namespace crow
#else
-> typename std::result_of<decltype (&Router::new_rule_tagged<Tag>)(
Router, std::string&&)>::type
#endif
#endif
{
return router_.new_rule_tagged<Tag>(std::move(rule));

View File

@ -57,3 +57,7 @@
#define noexcept throw()
#endif
#endif
#if __GNUC__ == 8 && __cplusplus > 201103L
#define CROW_GCC8_WORKAROUND
#endif