Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-21 21:39:19 +0200
committerMartin Hořeňovský2020-05-21 22:58:33 +0200
commit1356788ea8c61341a2865d1f31281b7f006d0ce3 (patch)
tree4839654bf277705bd533599badb585e4a8f659fb /src/catch2/internal
parent21d284df340c2c20d20e4b75120cff039a46ca54 (diff)
downloadcatch3-1356788ea8c61341a2865d1f31281b7f006d0ce3.tar.gz
Avoid using std::result_of when std::invoke_result is available
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_meta.hpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/catch2/internal/catch_meta.hpp b/src/catch2/internal/catch_meta.hpp
index 56cfa0a9..d1455e35 100644
--- a/src/catch2/internal/catch_meta.hpp
+++ b/src/catch2/internal/catch_meta.hpp
@@ -32,13 +32,12 @@ namespace Catch {
#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
// std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
- // replaced with std::invoke_result here. Also *_t format is preferred over
- // typename *::type format.
- template <typename Func, typename U>
- using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U>>>;
+ // replaced with std::invoke_result here.
+ template <typename Func, typename... U>
+ using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U...>>>;
#else
- template <typename Func, typename U>
- using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::result_of_t<Func(U)>>>;
+ template <typename Func, typename... U>
+ using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::result_of_t<Func(U...)>>>;
#endif
} // namespace Catch