瀏覽代碼

Single-parameter constructors should be marked explicit.

Nicolas "Pixel" Noble 10 年之前
父節點
當前提交
68095aab7d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      cpp/helloworld/greeter_async_client.cc

+ 1 - 1
cpp/helloworld/greeter_async_client.cc

@@ -59,7 +59,7 @@ using helloworld::Greeter;
 
 
 class GreeterClient {
 class GreeterClient {
  public:
  public:
-  GreeterClient(std::shared_ptr<ChannelInterface> channel)
+  explicit GreeterClient(std::shared_ptr<ChannelInterface> channel)
       : stub_(Greeter::NewStub(channel)) {}
       : stub_(Greeter::NewStub(channel)) {}
 
 
   std::string SayHello(const std::string& user) {
   std::string SayHello(const std::string& user) {