From 9151b84c250c86293574392fdc5443d303d9b246 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 21 Aug 2018 12:26:19 +0200 Subject: [PATCH] net/AllocatedSocketAddress: convert operator== to template --- src/net/AllocatedSocketAddress.hxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/net/AllocatedSocketAddress.hxx b/src/net/AllocatedSocketAddress.hxx index 772ae9657..10f61624a 100644 --- a/src/net/AllocatedSocketAddress.hxx +++ b/src/net/AllocatedSocketAddress.hxx @@ -84,13 +84,16 @@ public: return *this; } + template gcc_pure - bool operator==(SocketAddress other) const noexcept { - return (SocketAddress)*this == other; + bool operator==(T &&other) const noexcept { + return (SocketAddress)*this == std::forward(other); } - bool operator!=(SocketAddress other) const noexcept { - return !(*this == other); + template + gcc_pure + bool operator!=(T &&other) const noexcept { + return !(*this == std::forward(other)); } gcc_const