mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-19 21:03:51 +00:00
17 lines
313 B
C++
17 lines
313 B
C++
|
#include <IO/WriteBuffer.h>
|
||
|
#include <IO/ReadBuffer.h>
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
class SwapHelper
|
||
|
{
|
||
|
public:
|
||
|
SwapHelper(BufferBase & b1_, BufferBase & b2_) : b1(b1_), b2(b2_) { b1.swap(b2); }
|
||
|
~SwapHelper() { b1.swap(b2); }
|
||
|
|
||
|
private:
|
||
|
BufferBase & b1;
|
||
|
BufferBase & b2;
|
||
|
};
|
||
|
}
|