Commit 7b05df8d authored by Max Kellermann's avatar Max Kellermann

net/AllocatedSocketAddress: use C++11 initializers

parent a8db9ae3
...@@ -45,18 +45,17 @@ public: ...@@ -45,18 +45,17 @@ public:
typedef SocketAddress::size_type size_type; typedef SocketAddress::size_type size_type;
private: private:
struct sockaddr *address; struct sockaddr *address = nullptr;
size_type size; size_type size = 0;
AllocatedSocketAddress(struct sockaddr *_address, AllocatedSocketAddress(struct sockaddr *_address,
size_type _size) size_type _size)
:address(_address), size(_size) {} :address(_address), size(_size) {}
public: public:
AllocatedSocketAddress():address(nullptr), size(0) {} AllocatedSocketAddress() = default;
explicit AllocatedSocketAddress(SocketAddress src) explicit AllocatedSocketAddress(SocketAddress src) {
:address(nullptr), size(0) {
*this = src; *this = src;
} }
......
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