Commit 0195d559 authored by Max Kellermann's avatar Max Kellermann

net/AllocatedSocketAddress: allow copying

parent e7bebb00
...@@ -59,7 +59,8 @@ public: ...@@ -59,7 +59,8 @@ public:
*this = src; *this = src;
} }
AllocatedSocketAddress(const AllocatedSocketAddress &) = delete; AllocatedSocketAddress(const AllocatedSocketAddress &src) noexcept
:AllocatedSocketAddress((SocketAddress)src) {}
AllocatedSocketAddress(AllocatedSocketAddress &&src) noexcept AllocatedSocketAddress(AllocatedSocketAddress &&src) noexcept
:address(src.address), size(src.size) { :address(src.address), size(src.size) {
...@@ -73,7 +74,9 @@ public: ...@@ -73,7 +74,9 @@ public:
AllocatedSocketAddress &operator=(SocketAddress src) noexcept; AllocatedSocketAddress &operator=(SocketAddress src) noexcept;
AllocatedSocketAddress &operator=(const AllocatedSocketAddress &) = delete; AllocatedSocketAddress &operator=(const AllocatedSocketAddress &src) noexcept {
return *this = (SocketAddress)src;
}
AllocatedSocketAddress &operator=(AllocatedSocketAddress &&src) noexcept { AllocatedSocketAddress &operator=(AllocatedSocketAddress &&src) noexcept {
std::swap(address, src.address); std::swap(address, src.address);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment