|
|
|
@ -36,15 +36,15 @@ class DumpArgs { |
|
|
|
|
template <typename... Args> |
|
|
|
|
explicit DumpArgs(const char* arg_string, const Args&... args) |
|
|
|
|
: arg_string_(arg_string) { |
|
|
|
|
do_these_things( |
|
|
|
|
{AddDumper([a = &args](std::ostream& os) { os << *a; })...}); |
|
|
|
|
do_these_things({AddDumper(&args)...}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
friend std::ostream& operator<<(std::ostream& out, const DumpArgs& args); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
int AddDumper(absl::AnyInvocable<void(std::ostream&) const> dumper) { |
|
|
|
|
arg_dumpers_.push_back(std::move(dumper)); |
|
|
|
|
template <typename T> |
|
|
|
|
int AddDumper(T* p) { |
|
|
|
|
arg_dumpers_.push_back([p](std::ostream& os) { os << *p; }); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -66,4 +66,4 @@ class DumpArgs { |
|
|
|
|
#define GRPC_DUMP_ARGS(...) \ |
|
|
|
|
grpc_core::dump_args_detail::DumpArgs(#__VA_ARGS__, __VA_ARGS__) |
|
|
|
|
|
|
|
|
|
#endif // GRPC_SRC_CORE_LIB_GPRPP_DUMP_ARGS_H
|
|
|
|
|
#endif // GRPC_SRC_CORE_LIB_GPRPP_DUMP_ARGS_H
|