« Return to Thread: Non copyable curves.

Non copyable curves.

by Simon Ibbotson - Straumur :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi guys,

 

Why have all curves recently been derived from boost::noncopyable?

 

I’ve been copying yieldcurves (in external code) – and it has been working perfectly if you implement a copy constructor for the PiecewiseYieldcurve class that initializes the bootstrapper for the current curve (in the code I submitted – shown below). Surely this makes more sense than completely disabling copying?

 

 

 

//copy constructor

        PiecewiseYieldCurve(const this_curve& o)

            : base_curve(o), instruments_(o.instruments_), turnOfYearEffect_(o.turnOfYearEffect_),

            accuracy_(o.accuracy_), latestReference_(o.latestReference_), turnOfYear_(o.turnOfYear_),

            bootstrap_(o.bootstrap_) {

                setTurnOfYear();

                registerWith(turnOfYearEffect_);

                bootstrap_.setup(this);

        }

 

Simon Ibbotson

Quantitative Analytics

Capital Markets

Straumur

 


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

 « Return to Thread: Non copyable curves.

LightInTheBox - Buy quality products at wholesale price