From 7b05df8d33fa7c79ddaea223efbcb0b8d290aebd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 May 2017 12:06:45 +0200 Subject: [PATCH] net/AllocatedSocketAddress: use C++11 initializers --- src/net/AllocatedSocketAddress.hxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/net/AllocatedSocketAddress.hxx b/src/net/AllocatedSocketAddress.hxx index e7350cb8e..8e9bac8da 100644 --- a/src/net/AllocatedSocketAddress.hxx +++ b/src/net/AllocatedSocketAddress.hxx @@ -45,18 +45,17 @@ public: typedef SocketAddress::size_type size_type; private: - struct sockaddr *address; - size_type size; + struct sockaddr *address = nullptr; + size_type size = 0; AllocatedSocketAddress(struct sockaddr *_address, size_type _size) :address(_address), size(_size) {} public: - AllocatedSocketAddress():address(nullptr), size(0) {} + AllocatedSocketAddress() = default; - explicit AllocatedSocketAddress(SocketAddress src) - :address(nullptr), size(0) { + explicit AllocatedSocketAddress(SocketAddress src) { *this = src; }