c++禁用拷贝构造函数和赋值函数

 
 
// A macro to disallow the copy constructor and operator= functions
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete;
#endif
 
节选自 https://github.com/PlatformLab/NanoLog.git
代码中: <<common.h>>
posted @ 2019-12-28 10:13  hbg-rohens  阅读(1262)  评论(0编辑  收藏  举报