Use *_t and *_v trait helpers from C++17 STL (#731)

This commit is contained in:
Bart Louwers
2023-01-26 10:10:33 +00:00
committed by GitHub
parent e94f0e9b1b
commit f7fa009f08
24 changed files with 58 additions and 59 deletions

View File

@@ -38,11 +38,7 @@ public:
template <typename Fn, class... Args>
auto ask(Fn fn, Args&&... args) const {
// Result type is deduced from the function's return type
#if __cplusplus >= 201703L
using ResultType = std::invoke_result_t<decltype(fn), Object, Args...>;
#else
using ResultType = typename std::result_of<decltype(fn)(Object, Args...)>::type;
#endif
std::promise<ResultType> promise;
auto future = promise.get_future();