On Dec 22, 2007, at 5:49 PM,
[hidden email] wrote:
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
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev