diff options
author | Max Kellermann <max@duempel.org> | 2014-08-07 09:02:24 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-07 09:02:24 +0200 |
commit | cf16d81fa48dbe8f9030a3026bc6a1fabf4c6da6 (patch) | |
tree | 70fa229ad1381cc966aee0041e4ba7d0c1bbab1b /src/util/ForeignFifoBuffer.hxx | |
parent | 2beb763b4f3d12de7240d9811d8e4baaa094aab6 (diff) |
util/ForeignFifoBuffer: add method Swap()
Diffstat (limited to 'src/util/ForeignFifoBuffer.hxx')
-rw-r--r-- | src/util/ForeignFifoBuffer.hxx | 7 |
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; } |