One follow-up question: Is it safe to create a stub through its constructor
Service::Stub(channel) rather than the function Service::NewStub(channel)?
I'm asking this because I'm writing a function like this
template <typename T, typename Request, typename Response>
Response send(
const shared_ptr<Channel>& channel,
unique_ptr<ClientAsyncResponseReader<Response>(T::*method)(
ClienContext*, const Request&, CompletionQueue*),
const Request& request);
And I'd like to have all type arguments inferred automatically.
However, here I can only get T as a Stub class,
and it is impossible to infer the Service class,
so I cannot use Service::NewStub().
Thank you in advance,
Chun-Hung