]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: unthrowable_wrapper::handle() accepts type-taking lambda.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 20 Sep 2019 11:32:37 +0000 (13:32 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 20 Nov 2019 19:37:42 +0000 (20:37 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/common/errorator.h

index bc5ea00653e065d58f7044bb33a767e677971137..0df8b8b8d533574952324d4f3380cd256a651b56 100644 (file)
@@ -65,7 +65,11 @@ struct unthrowable_wrapper : error_t<unthrowable_wrapper<ErrorT, ErrorV>> {
     return [
       func = std::forward<Func>(func)
     ] (const unthrowable_wrapper&) mutable -> decltype(auto) {
-      return std::invoke(std::forward<Func>(func));
+      if constexpr (std::is_invocable_v<Func, ErrorT>) {
+        return std::invoke(std::forward<Func>(func), ErrorV);
+      } else {
+        return std::invoke(std::forward<Func>(func));
+      }
     };
   }