Re: class Instrument, virtual destructor

Posted by Kim Kuen Tang on
URL: http://quantlib.414.s1.nabble.com/class-Instrument-virtual-destructor-tp6569p6571.html

Hi Luigi,

you are right. I have forgotten that every derived class will
automatically have a virtual destructor if the base class has a virtual
destructor.

Btw,  a colleague and me have written seveal methods( Gausskronrod
,trapezoid,...) (implemented using abstract class) to integrate over a 2
dimensional boost::function<Real (Real,Real)>.
And we would like to contribute it to QuantLib. Would u please tell me
what to do next? Or where can i read the detail?

with regards,
Kim Tang

Luigi Ballabio schrieb:

>
> On Sep 3, 2008, at 7:46 PM, Kim Kuen Tang wrote:
>> the class Instrument is defined as an abstract class. For that reason
>> it should be provided with a virtual destructor
>>
>> virtual ~Instrument(){};
>>
>> to avoid memory leak. I hope that someone can add  this to the file.
>
> Kim,
>     the Instrument class inherits from LazyObject, which defines a
> virtual destructor.  Therefore, there's no need to declare one in
> Instrument.
>
> Luigi
>
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users