BewareMyPower commented on code in PR #253:
URL: https://github.com/apache/pulsar-client-cpp/pull/253#discussion_r1169422748


##########
lib/ConnectionPool.h:
##########
@@ -41,7 +41,8 @@ using ExecutorServiceProviderPtr = 
std::shared_ptr<ExecutorServiceProvider>;
 class PULSAR_PUBLIC ConnectionPool {
    public:
     ConnectionPool(const ClientConfiguration& conf, ExecutorServiceProviderPtr 
executorProvider,
-                   const AuthenticationPtr& authentication, bool 
poolConnections = true);
+                   const AuthenticationPtr& authentication, bool 
poolConnections,

Review Comment:
   IMO, the default arguments feature is used when the overloads can be 
simplified. For example, assuming we'd have two overloads:
   
   ```c++
   // Overload 1
   void f(int x, int y) { /* ... */ }
   // Overload 2
   void f(int x) { f(x, 0); }
   ```
   
   Then we can simplify them to:
   
   ```c++
   void f(int x, int y = 0) { /* ... */ }
   ```
   
   It would be more clear.
   
   However, in the case here, we don't need any overload as I've explained 
before:
   
   > In the lib/ subdirectory, the constructor of ConnectionPool is only called 
in ClientImpl's constructor, so we only need one constructor.
   
   If the overloads are only used for tests, we should not add them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to