Re: Question to the Leap function in the Date class

Posted by Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/Question-to-the-Leap-function-in-the-Date-class-tp13132p13133.html

Hi Alexander

> I've got an exception using the Date class Leap function. I've checked the
> code and found out that the function is limited to the range 1900..2200. The
> implementation of the leap function is quite simple. Is there a performance
> reason to implement it like this? If it is possible I would like to extend
> this function.

I suggest you to just replace the current implementation with

#include <boost/date_time/gregorian/gregorian.hpp>
[...]
namespace QuantLib {
[...]
   bool Date::isLeap(Year y) {

       return boost::gregorian::gregorian_calendar::is_leap_year(y);
   }
[...]
}


I will commit this change unless objections are raised

ciao -- Nando

PS any volunteer for QuantLib::Date boostification, i.e. usage of boost::gregorian in the implementation of QuantLib::Date ?

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev