Commit ce9f09c6 authored by Max Kellermann's avatar Max Kellermann

event/ServerSocket: make AddAddress() a template

parent 3ddc7a53
......@@ -265,20 +265,12 @@ ServerSocket::Close() noexcept
i.Close();
}
template<typename A>
ServerSocket::OneServerSocket &
ServerSocket::AddAddress(SocketAddress address) noexcept
ServerSocket::AddAddress(A &&address) noexcept
{
sockets.emplace_back(loop, *this, next_serial,
address);
return sockets.back();
}
ServerSocket::OneServerSocket &
ServerSocket::AddAddress(AllocatedSocketAddress &&address) noexcept
{
sockets.emplace_back(loop, *this, next_serial,
std::move(address));
std::forward<A>(address));
return sockets.back();
}
......
......@@ -49,8 +49,8 @@ public:
}
private:
OneServerSocket &AddAddress(SocketAddress address) noexcept;
OneServerSocket &AddAddress(AllocatedSocketAddress &&address) noexcept;
template<typename A>
OneServerSocket &AddAddress(A &&address) noexcept;
/**
* Add a listener on a port on all IPv4 interfaces.
......
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