2-muduo-base-copyable
注意的点:
构造函数和析构函数都是声明为protected,防止直接构造copyable对象,只能通过继承的方式。下面这段代码会报错:
error: ‘constexpr muduo::copyable::copyable()’ is protected within this context
4 | muduo::copyable c;
error: ‘muduo::copyable::~copyable()’ is protected within this context
4 | muduo::copyable c;

浙公网安备 33010602011771号