From cf16d81fa48dbe8f9030a3026bc6a1fabf4c6da6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 7 Aug 2014 09:02:24 +0200 Subject: util/ForeignFifoBuffer: add method Swap() --- src/util/ForeignFifoBuffer.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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 &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; } -- cgit v1.2.3