szaszm commented on a change in pull request #713: MINIFICPP-1119 unify 
win/posix sockets + clean up issues
URL: https://github.com/apache/nifi-minifi-cpp/pull/713#discussion_r374641290
 
 

 ##########
 File path: libminifi/include/io/ClientSocket.h
 ##########
 @@ -93,7 +109,7 @@ class Socket : public BaseStream {
    */
   virtual int16_t initialize();
 
-  virtual void setInterface(io::NetworkInterface &&interface) {
+  virtual void setInterface(io::NetworkInterface interface) noexcept {
 
 Review comment:
   I know `noexcept` is rarely used in our codebase but I usually prefer to 
mark things that do not throw as `noexcept`. The only value is extra 
documentation and one more register available during code generation, but it's 
a good default IMO. The downside is if we use it carelessly, exceptions become 
crashes.
   
   
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#e12-use-noexcept-when-exiting-a-function-because-of-a-throw-is-impossible-or-unacceptable
   
   I'm open to deciding to use another approach, but in that case we need to 
formalize it. I'd prefer the above.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to