util/ForeignFifoBuffer: add method Swap()

This commit is contained in:
Max Kellermann 2014-08-07 09:02:24 +02:00
parent 2beb763b4f
commit cf16d81fa4
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}