17 lines
396 B
C++
17 lines
396 B
C++
#ifndef NONCOPYABLE_H_
|
|
#define NONCOPYABLE_H_
|
|
|
|
//禁止拷贝基类
|
|
class noncopyable {
|
|
protected:
|
|
noncopyable() {}
|
|
~noncopyable() {}
|
|
private:
|
|
//禁止拷贝
|
|
noncopyable(const noncopyable &that) = delete;
|
|
noncopyable(noncopyable &&that) = delete;
|
|
noncopyable &operator=(const noncopyable &that) = delete;
|
|
noncopyable &operator=(noncopyable &&that) = delete;
|
|
};
|
|
|
|
#endif |