|
From: Luigi B. <lui...@gm...> - 2007-12-22 21:18:51
|
On Dec 22, 2007, at 5:49 PM, na...@us... wrote: > Revision: 13872 > > http://quantlib.svn.sourceforge.net/quantlib/?rev=13872&view=rev > Author: nando > Date: 2007-12-22 08:49:11 -0800 (Sat, 22 Dec 2007) > > Log Message: > ----------- > switched signatures to Natural instead of Integer and const Date& > instead of Date Nando, in the function you modified, the Date was passed by value on purpose. That way, it could be modified: > Real CashFlows::npv(const Leg& cashflows, > const InterestRate& irr, > - Date settlementDate) { > - if (settlementDate == Date()) > - settlementDate = Settings::instance().evaluationDate(); whereas if you pass it by const reference, you have to introduce an additional object: > + Date refDate = settlDate; > + if (refDate == Date()) > + refDate = Settings::instance().evaluationDate(); Also, why "settlDate"? Looks less readable to me. Merry Christmas, Luigi |