On Tue, Mar 29, 2011 at 11:47 AM, Gaetano Mendola <[email protected]> wrote:
> Hi guys,
> the addMonths and the addYears can lead to invalid date generation like:
>
> "Tue Mar 29 2011" - 1 Month would become 29 February 2011 and that
> is a not a valid date.
>
> I reimplemented addMonths and addYears in term of boost::gregorian
> date arithmetic, patch
> is inline. I have also seen that WDate class has the members year_,
> month_ and day_, you
> can remove those and use the date::ymd_type (your choice).
>
> Gaetano
While you are at it you can reimplement the WDate::isLeapYear like this:
bool WDate::isLeapYear(int year)
{
return gregorian_calendar::is_leap_year(year);
}
Gaetano
--
cpp-today.blogspot.com
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest