diff --git a/cmake/build.cmake b/cmake/build.cmake index 2a71653..ae50dab 100644 --- a/cmake/build.cmake +++ b/cmake/build.cmake @@ -1,5 +1,5 @@ # Compile Standard -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++20") # Build Type if(NOT CMAKE_BUILD_TYPE) diff --git a/include/rest_rpc/router.h b/include/rest_rpc/router.h index 6d3a01b..4523e79 100644 --- a/include/rest_rpc/router.h +++ b/include/rest_rpc/router.h @@ -126,15 +126,15 @@ private: router(router &&) = delete; template - static typename std::result_of, Args...)>::type + static std::invoke_result_t, Args...> call_helper(const F &f, const nonstd::index_sequence &, std::tuple tup, std::weak_ptr ptr) { return f(ptr, std::move(std::get(tup))...); } template - static typename std::enable_if, Args...)>::type>::value>::type + static typename std::enable_if, Args...>>::value>::type call(const F &f, std::weak_ptr ptr, std::string &result, std::tuple tp) { call_helper(f, nonstd::make_index_sequence{}, @@ -143,8 +143,8 @@ private: } template - static typename std::enable_if, Args...)>::type>::value>::type + static typename std::enable_if, Args...>>::value>::type call(const F &f, std::weak_ptr ptr, std::string &result, std::tuple tp) { auto r = call_helper(f, nonstd::make_index_sequence{}, @@ -154,19 +154,17 @@ private: } template - static - typename std::result_of, Args...)>::type - call_member_helper(const F &f, Self *self, - const nonstd::index_sequence &, - std::tuple tup, - std::weak_ptr ptr = - std::shared_ptr{nullptr}) { + static std::invoke_result_t, Args...> + call_member_helper( + const F &f, Self *self, const nonstd::index_sequence &, + std::tuple tup, + std::weak_ptr ptr = std::shared_ptr{nullptr}) { return (*self.*f)(ptr, std::move(std::get(tup))...); } template - static typename std::enable_if, Args...)>::type>::value>::type + static typename std::enable_if, Args...>>::value>::type call_member(const F &f, Self *self, std::weak_ptr ptr, std::string &result, std::tuple tp) { call_member_helper(f, self, @@ -176,8 +174,8 @@ private: } template - static typename std::enable_if, Args...)>::type>::value>::type + static typename std::enable_if, Args...>>::value>::type call_member(const F &f, Self *self, std::weak_ptr ptr, std::string &result, std::tuple tp) { auto r = call_member_helper(