aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp/impl/codegen/callback_common.h
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-10-24 02:28:57 -0700
committerGravatar Vijay Pai <vpai@google.com>2018-10-24 02:28:57 -0700
commit22dc39ae6696638a14ca802aa2b3a962f0b4393b (patch)
tree44bc3a17a3a5f65db2ec969ba44281d25135f2ba /include/grpcpp/impl/codegen/callback_common.h
parent5984e9daf26123bab25279f74e43d60908f199bf (diff)
Change CatchingCallback function to be varargs for broader use
Diffstat (limited to 'include/grpcpp/impl/codegen/callback_common.h')
-rw-r--r--include/grpcpp/impl/codegen/callback_common.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/grpcpp/impl/codegen/callback_common.h b/include/grpcpp/impl/codegen/callback_common.h
index ca2f867d04..a9835973ac 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 <class Func, class Arg>
-void CatchingCallback(Func&& func, Arg&& arg) {
+template <class Func, class... Args>
+void CatchingCallback(Func&& func, Args&&... args) {
#if GRPC_ALLOW_EXCEPTIONS
try {
- func(arg);
+ func(std::forward<Args>(args)...);
} catch (...) {
// nothing to return or change here, just don't crash the library
}
#else // GRPC_ALLOW_EXCEPTIONS
- func(arg);
+ func(std::forward<Args>(args)...);
#endif // GRPC_ALLOW_EXCEPTIONS
}