30 Sep
2005
30 Sep
'05
1:21 p.m.
Markus , Appreciate your help, can you explain what's the rationale that you use "reset" instead of a simple more natural way of "assign". John Markus Schöpflin wrote:
John Sun wrote:
<snip>
You can't assign anything to a scoped ptr, you have to use it's reset member function. (See http://www.boost.org/libs/smart_ptr/scoped_ptr.htm.)
CTest::Initialize() { int aa, bb; m_spTest2=new CTest2(aa, bb);
m_spTest2.reset(new CTest2(aa, bb));
}
Markus