Login  Register

Re: quantlib Handle compile error

Posted by simoncourtenage on May 24, 2010; 9:34am
URL: http://quantlib.414.s1.nabble.com/quantlib-Handle-compile-error-tp7722p7735.html

Sorry for asking what might be a silly question but if, in Handle<T>,  
T must inherit from Observable, why is Handle a template class?

Thanks

Simon Courtenage



On 24 May 2010, at 09:19, Luigi Ballabio <[hidden email]>  
wrote:

> On Mon, 2010-05-24 at 15:30 +0800, P Nelnik wrote:
>> Thanks Luigi and Simons (I & II) for your responses.
>>
>> A couple of suggestion:
>> 1: perhaps we should change the code in
>> Examples/EquityOption/EquityOption.cpp:
>>
>>        Handle<YieldTermStructure> flatTermStructure(
>>            boost::shared_ptr<YieldTermStructure>(
>>                new FlatForward(settlementDate, riskFreeRate,
>> dayCounter)));
>>    since it may leak memory and it sets a bad example.
>
> Where can it leak memory?
>
>> 2: When a developer tries to implement Handle<T> where T doesn't
>> derive from Observable,
>>     he's told there is an error in:
>>        inline void Handle<T>::Link::linkTo(const
>> boost::shared_ptr<T>& h, bool registerAsObserver) {
>>    A one line comment in that could warning developers that T must
>> derive from Observable
>
> It's already in the documentation for Handle (the docs before the  
> class
> definition.)
>
> Luigi
>
>
> --
>
> Zawinski's Law:
> Every program attempts to expand until it can read mail. Those
> programs which cannot so expand are replaced by ones which can.
>
>
>
> ---
> ---
> ---
> ---------------------------------------------------------------------
>
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users