aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-07 09:02:24 +0200
committerMax Kellermann <max@duempel.org>2014-08-07 09:02:24 +0200
commitcf16d81fa48dbe8f9030a3026bc6a1fabf4c6da6 (patch)
tree70fa229ad1381cc966aee0041e4ba7d0c1bbab1b /src
parent2beb763b4f3d12de7240d9811d8e4baaa094aab6 (diff)
downloadmpd-cf16d81fa48dbe8f9030a3026bc6a1fabf4c6da6.tar.gz
mpd-cf16d81fa48dbe8f9030a3026bc6a1fabf4c6da6.tar.xz
mpd-cf16d81fa48dbe8f9030a3026bc6a1fabf4c6da6.zip
util/ForeignFifoBuffer: add method Swap()
Diffstat (limited to '')
-rw-r--r--src/util/ForeignFifoBuffer.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/ForeignFifoBuffer.hxx b/src/util/ForeignFifoBuffer.hxx
index c52846727..0ebcd6069 100644
--- a/src/util/ForeignFifoBuffer.hxx
+++ b/src/util/ForeignFifoBuffer.hxx
@@ -82,6 +82,13 @@ public:
return *this;
}
+ void Swap(ForeignFifoBuffer<T> &other) {
+ std::swap(head, other.head);
+ std::swap(tail, other.tail);
+ std::swap(capacity, other.capacity);
+ std::swap(data, other.data);
+ }
+
constexpr bool IsNull() const {
return data == nullptr;
}