#define DISALLOW_COPY(ClassName) \
ClassName(const ClassName&) = delete; \
ClassName& operator=(const ClassName&) = delete
#define DISALLOW_MOVE(ClassName) \
ClassName(ClassName&&) = delete; \
ClassName& operator=(ClassName&&) = delete
#define DISALLOW_COPY_AND_MOVE(ClassName) \
DISALLOW_COPY(ClassName); \
DISALLOW_MOVE(ClassName)
class ClassA final {
public:
ClassA(){}
~ClassA() {}
DISALLOW_COPY_AND_MOVE(ClassA);
void Reset();
void CopyFrom(const ClassA* src);
void Swap(ClassA* other);
private:
void* buffer_;
size_t buffer_size_;
};
标签:COPY,函数,void,MOVE,C++,DISALLOW,ClassName,拷贝,ClassA
From: https://www.cnblogs.com/sunwenqi/p/17399528.html