Merge pull request #9786 from vjpai/heldplace

Eliminate a "using namespace"
pull/6854/head
Vijay Pai 8 years ago committed by GitHub
commit c6a4539f80
  1. 19
      test/cpp/qps/server_async.cc

@ -103,24 +103,25 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
server_ = builder.BuildAndStart(); server_ = builder.BuildAndStart();
using namespace std::placeholders;
auto process_rpc_bound = auto process_rpc_bound =
std::bind(process_rpc, config.payload_config(), _1, _2); std::bind(process_rpc, config.payload_config(), std::placeholders::_1,
std::placeholders::_2);
for (int i = 0; i < 15000; i++) { for (int i = 0; i < 15000; i++) {
for (int j = 0; j < num_threads; j++) { for (int j = 0; j < num_threads; j++) {
if (request_unary_function) { if (request_unary_function) {
auto request_unary = auto request_unary = std::bind(
std::bind(request_unary_function, &async_service_, _1, _2, _3, request_unary_function, &async_service_, std::placeholders::_1,
srv_cqs_[j].get(), srv_cqs_[j].get(), _4); std::placeholders::_2, std::placeholders::_3, srv_cqs_[j].get(),
srv_cqs_[j].get(), std::placeholders::_4);
contexts_.emplace_back( contexts_.emplace_back(
new ServerRpcContextUnaryImpl(request_unary, process_rpc_bound)); new ServerRpcContextUnaryImpl(request_unary, process_rpc_bound));
} }
if (request_streaming_function) { if (request_streaming_function) {
auto request_streaming = auto request_streaming = std::bind(
std::bind(request_streaming_function, &async_service_, _1, _2, request_streaming_function, &async_service_,
srv_cqs_[j].get(), srv_cqs_[j].get(), _3); std::placeholders::_1, std::placeholders::_2, srv_cqs_[j].get(),
srv_cqs_[j].get(), std::placeholders::_3);
contexts_.emplace_back(new ServerRpcContextStreamingImpl( contexts_.emplace_back(new ServerRpcContextStreamingImpl(
request_streaming, process_rpc_bound)); request_streaming, process_rpc_bound));
} }

Loading…
Cancel
Save