Login  Register

Re: pure virtual function call in observable update

Posted by Bojan Nikolic on Apr 28, 2011; 1:44pm
URL: http://quantlib.414.s1.nabble.com/pure-virtual-function-call-in-observable-update-tp13453p13456.html


Hi Alan,

"Fischbein, Alan: C12 (NYK)" <[hidden email]> writes:

> Does this mean that even my unmanaged classes cannot reference non-CLR
> supported types in their definition? (as opposed to implementation.)
> Thanks.

I think in standard C++ parlance you mean "in declaration as opposed to
definition".

The answer (I think) is that you can use non-CLR compatible types only
by having them as incomplete types in your unmanaged class declaration
(i.e., the part that is in the ".h" file). In other words, you forward
declare the non-CLR compatible QuantLib types you wish to use in your
NativeInterestCurve. For example, you can do

class YieldTermStructure;
class NativeInterestCurve
{
        boost::scoped_ptr<YieldTermStructure> TermStructure_;
};

But note that you can not use boost::shared_ptr there as that requires a
complete type.

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today.  Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev