bakaid 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_r377129704
 
 

 ##########
 File path: libminifi/include/io/NetworkPrioritizer.h
 ##########
 @@ -83,29 +66,26 @@ class NetworkInterface {
     }
   }
 
-  NetworkInterface &operator=(const NetworkInterface &&other) {
-    ifc_ = std::move(other.ifc_);
-    prioritizer_ = std::move(other.prioritizer_);
-    return *this;
-  }
+  NetworkInterface &operator=(const NetworkInterface &other) = default;
+  NetworkInterface &operator=(NetworkInterface &&other) 
noexcept(std::is_nothrow_move_assignable<std::string>::value) = default;
 
 Review comment:
   This is very nice until someone comes along and adds another class member 
whose move assignment operator throws, but forgets to update this expression. 
And he will.
   This stands for the move constructor as well. There is a place for noexcept, 
and when there is, we should use it, but I am wary using it preemptively: we 
gain very little, but if someone comes along and modifies things without 
rethinking the noexcept guarantees we have a potential abort on our hands.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to