summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-08-21 12:26:19 +0200
committerMax Kellermann <max@musicpd.org>2018-08-21 12:26:19 +0200
commit9151b84c250c86293574392fdc5443d303d9b246 (patch)
tree41f0e6482b7a2d7660132e2ae0940db4a23ef881 /src/net
parent5d7dd12f7ac33a3f62b32d38117537a69ef48fdc (diff)
net/AllocatedSocketAddress: convert operator== to template
Diffstat (limited to 'src/net')
-rw-r--r--src/net/AllocatedSocketAddress.hxx11
1 files 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<typename T>
gcc_pure
- bool operator==(SocketAddress other) const noexcept {
- return (SocketAddress)*this == other;
+ bool operator==(T &&other) const noexcept {
+ return (SocketAddress)*this == std::forward<T>(other);
}
- bool operator!=(SocketAddress other) const noexcept {
- return !(*this == other);
+ template<typename T>
+ gcc_pure
+ bool operator!=(T &&other) const noexcept {
+ return !(*this == std::forward<T>(other));
}
gcc_const