From 22dc39ae6696638a14ca802aa2b3a962f0b4393b Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 24 Oct 2018 02:28:57 -0700 Subject: [PATCH] Change CatchingCallback function to be varargs for broader use --- include/grpcpp/impl/codegen/callback_common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/grpcpp/impl/codegen/callback_common.h b/include/grpcpp/impl/codegen/callback_common.h index ca2f867d04d..a9835973acc 100644 --- a/include/grpcpp/impl/codegen/callback_common.h +++ b/include/grpcpp/impl/codegen/callback_common.h @@ -32,16 +32,16 @@ namespace grpc { namespace internal { /// An exception-safe way of invoking a user-specified callback function -template -void CatchingCallback(Func&& func, Arg&& arg) { +template +void CatchingCallback(Func&& func, Args&&... args) { #if GRPC_ALLOW_EXCEPTIONS try { - func(arg); + func(std::forward(args)...); } catch (...) { // nothing to return or change here, just don't crash the library } #else // GRPC_ALLOW_EXCEPTIONS - func(arg); + func(std::forward(args)...); #endif // GRPC_ALLOW_EXCEPTIONS }