From 585107be9729fd69f061910dae9b643bec80bff8 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sun, 5 May 2024 22:57:13 -0700 Subject: [PATCH] Change `result_of` to `invoke_result` in watchman/Result.h Summary: C++20 has [eliminated](https://en.cppreference.com/w/cpp/types/result_of) `result_of` in favour of `invoke_result`. It's mysterious that this code even still works, but, nevertheless, I'm fixing it. Differential Revision: D56987484 fbshipit-source-id: e1e641424271e1164eee19be5726ec6abe0c1ffd --- watchman/Result.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/watchman/Result.h b/watchman/Result.h index 86f89468660b..ce2ca540c0af 100644 --- a/watchman/Result.h +++ b/watchman/Result.h @@ -269,10 +269,10 @@ Result::type, Error> makeResult(T&& t) { // This is the non-void return type flavor. template typename std::enable_if< - !std::is_same::type, void>::value, - Result::type>>::type + !std::is_same::type, void>::value, + Result::type>>::type makeResultWith(Func&& func) { - using ResType = typename std::result_of::type; + using ResType = typename std::invoke_result::type; try { return Result(func()); @@ -286,7 +286,7 @@ makeResultWith(Func&& func) { // This is the void return type flavor; it produces Result template typename std::enable_if< - std::is_same::type, void>::value, + std::is_same::type, void>::value, Result>::type makeResultWith(Func&& func) { try {