1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxmt.h(82): error C2248: “CObject::CObject”: 无法访问 private 成员(在“CObject”类中声明)
1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(534) : 参见“CObject::CObject”的声明
1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(509) : 参见“CObject”的声明
1> 此诊断出现在编译器生成的函数“CSyncObject::CSyncObject(const CSyncObject &)”中
缺省情况下,复制构造函数和赋值构造函数是不可用的
如果程序员通过传值或者赋值来传递对象,将得到一个编译错误
public:
inline const CEvent& GetEvent(){return this->m_event;}//正确
inline CEvent GetEvent(){return this->m_event;}//错误
private:
CEvent m_event;