util/ForeignFifoBuffer: add method Swap()
This commit is contained in:
@@ -82,6 +82,13 @@ public:
|
|||||||
return *this;
|
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 {
|
constexpr bool IsNull() const {
|
||||||
return data == nullptr;
|
return data == nullptr;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user