Skip to content

Commit

Permalink
Change result_of to invoke_result in mcrouter/McrouterFiberContext.h
Browse files Browse the repository at this point in the history
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: D56987436

fbshipit-source-id: 73c86ace2ef88a26d9f8daa1ea5cdf42d749fea4
  • Loading branch information
r-barnes authored and facebook-github-bot committed May 6, 2024
1 parent fd1c622 commit 4e492ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mcrouter/McrouterFiberContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class fiber_local {
* Clear all locals, run `f`, restore locals
*/
template <class F>
static typename std::result_of<F()>::type runWithoutLocals(F&& f) {
static typename std::invoke_result<F>::type runWithoutLocals(F&& f) {
auto guard = makeGuardHelperReset();

return f();
Expand All @@ -129,7 +129,7 @@ class fiber_local {
* Copy all locals, run `f`, restore locals
*/
template <class F>
static typename std::result_of<F()>::type runWithLocals(F&& f) {
static typename std::invoke_result<F>::type runWithLocals(F&& f) {
auto guard = makeGuardHelperCopy();

return f();
Expand Down

0 comments on commit 4e492ab

Please sign in to comment.