summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-12-14 08:00:10 -0600
committerChad Elliott <elliottc@objectcomputing.com>2022-12-14 08:00:10 -0600
commit8038e3e754d1307c2d465f3029909fd4f7b27a1b (patch)
tree58a247ce83832c542762c67ee84f01ff75645a1b
parent432c3c03538e5b227e8095c42f6a58a9744a9d77 (diff)
downloadATCD-8038e3e754d1307c2d465f3029909fd4f7b27a1b.tar.gz
Added an assignment operator because a copy constructor was defined. (ubuntu 22 - gcc 11 warning)
-rw-r--r--ACE/ace/MEM_Addr.h3
-rw-r--r--ACE/ace/MEM_Addr.inl12
2 files changed, 15 insertions, 0 deletions
diff --git a/ACE/ace/MEM_Addr.h b/ACE/ace/MEM_Addr.h
index 21728cf45e1..c9616082745 100644
--- a/ACE/ace/MEM_Addr.h
+++ b/ACE/ace/MEM_Addr.h
@@ -40,6 +40,9 @@ public:
/// Copy constructor.
ACE_MEM_Addr (const ACE_MEM_Addr &);
+ /// Assignment operator
+ ACE_MEM_Addr& operator= (const ACE_MEM_Addr& rhs);
+
/// Creates an ACE_MEM_Addr from a @a port_number
ACE_MEM_Addr (u_short port_number);
diff --git a/ACE/ace/MEM_Addr.inl b/ACE/ace/MEM_Addr.inl
index f849070acfb..7cf22ce26bc 100644
--- a/ACE/ace/MEM_Addr.inl
+++ b/ACE/ace/MEM_Addr.inl
@@ -4,6 +4,18 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+/// Assignment operator
+ACE_INLINE ACE_MEM_Addr&
+ACE_MEM_Addr::operator= (const ACE_MEM_Addr& rhs)
+{
+ if (this != &rhs)
+ {
+ this->external_.set (rhs.external_);
+ this->internal_.set (rhs.internal_);
+ }
+ return *this;
+}
+
/// Set the port number.
ACE_INLINE void
ACE_MEM_Addr::set_port_number (u_short port_number,