Non copyable curves.

Posted by Simon Ibbotson - Straumur on
URL: http://quantlib.414.s1.nabble.com/Non-copyable-curves-tp12013.html

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev