From 43002d5505231e9e13870d6bec044166dd86480e Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 10 Nov 2021 08:30:10 +0100 Subject: Add default assignment operator to fix gcc warnings * ACE/ace/MEM_Addr.cpp: * ACE/ace/MEM_Addr.h: * ACE/ace/SPIPE_Addr.h: * ACE/ace/UNIX_Addr.h: --- ACE/ace/MEM_Addr.cpp | 11 ----------- ACE/ace/MEM_Addr.h | 4 ++-- ACE/ace/SPIPE_Addr.h | 3 +++ ACE/ace/UNIX_Addr.h | 3 +++ 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ACE/ace/MEM_Addr.cpp b/ACE/ace/MEM_Addr.cpp index 4e759900abc..1e021a27deb 100644 --- a/ACE/ace/MEM_Addr.cpp +++ b/ACE/ace/MEM_Addr.cpp @@ -51,17 +51,6 @@ ACE_MEM_Addr::ACE_MEM_Addr (u_short port_number) this->initialize_local (port_number); } -ACE_MEM_Addr& -ACE_MEM_Addr::operator= (const ACE_MEM_Addr& sa) -{ - if (this != std::addressof(sa)) - { - this->external_.set (sa.external_); - this->internal_.set (sa.internal_); - } - return *this; -} - int ACE_MEM_Addr::initialize_local (u_short port_number) { diff --git a/ACE/ace/MEM_Addr.h b/ACE/ace/MEM_Addr.h index ae9e8be008e..26485148dfa 100644 --- a/ACE/ace/MEM_Addr.h +++ b/ACE/ace/MEM_Addr.h @@ -40,8 +40,8 @@ public: /// Copy constructor. ACE_MEM_Addr (const ACE_MEM_Addr &); - // Assignment operator - ACE_MEM_Addr& operator= (const ACE_MEM_Addr& sa); + /// Assignment operator + ACE_MEM_Addr& operator= (const ACE_MEM_Addr& sa) = default; /// Creates an ACE_MEM_Addr from a @a port_number ACE_MEM_Addr (u_short port_number); diff --git a/ACE/ace/SPIPE_Addr.h b/ACE/ace/SPIPE_Addr.h index 455acd9acbb..f72e7b77910 100644 --- a/ACE/ace/SPIPE_Addr.h +++ b/ACE/ace/SPIPE_Addr.h @@ -39,6 +39,9 @@ public: /// Copy constructor. ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa); + /// Assignment operator + ACE_SPIPE_Addr& operator= (const ACE_SPIPE_Addr& sa) = default; + /// Create a ACE_SPIPE_Addr from a rendezvous point in the file /// system. ACE_SPIPE_Addr (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0); diff --git a/ACE/ace/UNIX_Addr.h b/ACE/ace/UNIX_Addr.h index fed5df7fab6..1400760e6d1 100644 --- a/ACE/ace/UNIX_Addr.h +++ b/ACE/ace/UNIX_Addr.h @@ -43,6 +43,9 @@ public: /// Copy constructor. ACE_UNIX_Addr (const ACE_UNIX_Addr &sa); + /// Assignment operator + ACE_UNIX_Addr& operator= (const ACE_UNIX_Addr& sa) = default; + /// Creates an ACE_UNIX_Addr from a string. ACE_UNIX_Addr (const char rendezvous_point[]); -- cgit v1.2.1