class NotCopyable
{
public:
NotCopyable() { }
private:
NotCopyable(const NotCopyable&);
NotCopyable& operator = (const NotCopyable&);
};
class BasicTimer : private NotCopyable
{
public:
...
}
개인 상속을 사용할 권리가 있습니까?개인 상속을 사용할 권리가 있습니까?
기본 클래스에서 NotCopyable() {}을 (를) private로 선언하지 않는 이유는 무엇입니까? – Kim
@Kim : 최소한 (friend modifiers를 고려한 후) 접근성을 보호하는 생성자가 없다면 파생 클래스의 객체를 구성 할 수 없습니다. –