net/AllocatedSocketAddress: allow copying

This commit is contained in:
Max Kellermann 2017-05-17 12:19:24 +02:00
parent e7bebb0089
commit 0195d5590f
1 changed files with 5 additions and 2 deletions

View File

@ -59,7 +59,8 @@ public:
*this = src;
}
AllocatedSocketAddress(const AllocatedSocketAddress &) = delete;
AllocatedSocketAddress(const AllocatedSocketAddress &src) noexcept
:AllocatedSocketAddress((SocketAddress)src) {}
AllocatedSocketAddress(AllocatedSocketAddress &&src) noexcept
:address(src.address), size(src.size) {
@ -73,7 +74,9 @@ public:
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 {
std::swap(address, src.address);