Login  Register

Re: Dangerous constructor in Handle class

Posted by Ferdinando M. Ametrano-3 on Aug 01, 2011; 11:18am
URL: http://quantlib.414.s1.nabble.com/Dangerous-constructor-in-Handle-class-tp13562p13564.html

On Wed, Jul 20, 2011 at 11:05 AM, Luigi Ballabio
<[hidden email]> wrote:

> On Tue, 2011-07-19 at 18:03 -0400, Irakli Machabeli wrote:
>> What is the purpose of this constructor for the handle class?
>>
>> template <class T>
>> inline Handle<T>::Handle(T* p,bool registerAsObserver)
>> : link_(new Link(boost::shared_ptr<T>(p),registerAsObserver)) {}
>
> I guess it's just a shortcut to avoid declaring the boost shared pointer
> explicitly.  It's not much more dangerous than the shared_ptr
> constructor (you can have the same problem) but I agree that at least it
> should be documented.  I wouldn't remove it, because we're keeping
> backward compatibility with previous releases; but we can mark it as
> deprecated.

done

ciao -- Nando

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev