29 Sep
2005
29 Sep
'05
11:04 p.m.
New to this topic,and need some help here. I have a class which use the scoped_ptr as a member variable. Class CTest { public: CTest(); Initialize(); ~CTest(); private: scoped_ptr<CTest2> m_spTest2; } For some reason, that I cannot initialize m_spTest2 in the member initialization list of the constructor, so I have to initialize in some other functions like in Initialize. CTest::Initialize() { int aa, bb; m_spTest2=new CTest2(aa, bb); } The compiler will complain about that, so what's the right way to do it. Thanks, Jianwei