ClickHouse/src/IO/SwapHelper.h

17 lines
298 B
C++
Raw Normal View History

2023-01-20 11:19:19 +00:00
#pragma once
2023-01-19 17:58:09 +00:00
#include <IO/BufferBase.h>
2023-01-19 17:44:29 +00:00
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;
};
}