Skip to content
Snippets Groups Projects
Commit 1892b787 authored by David G. Quintas's avatar David G. Quintas
Browse files

Merge pull request #2939 from vjpai/emplace

Use emplace_back properly, considering limitations of gcc 4.4
parents d21ce042 1c9ba198
No related branches found
No related tags found
No related merge requests found
......@@ -240,8 +240,7 @@ bool Server::RegisterService(const grpc::string *host, RpcService* service) {
method->name());
return false;
}
SyncRequest request(method, tag);
sync_methods_->emplace_back(request);
sync_methods_->emplace_back(method, tag);
}
return true;
}
......@@ -286,7 +285,10 @@ bool Server::Start() {
if (!has_generic_service_) {
unknown_method_.reset(new RpcServiceMethod(
"unknown", RpcMethod::BIDI_STREAMING, new UnknownMethodHandler));
sync_methods_->emplace_back(unknown_method_.get(), nullptr);
// Use of emplace_back with just constructor arguments is not accepted here
// by gcc-4.4 because it can't match the anonymous nullptr with a proper
// constructor implicitly. Construct the object and use push_back.
sync_methods_->push_back(SyncRequest(unknown_method_.get(), nullptr));
}
// Start processing rpcs.
if (!sync_methods_->empty()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment