Boost logo

Boost Users :

From: John Sun (jsunnewsgroup_at_[hidden])
Date: 2005-09-30 08:21:56


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net