|
Boost : |
From: Powell, Gary (powellg_at_[hidden])
Date: 2004-04-14 14:10:58
Rob wrote:
>>
>> Ok, but you need more than just LAST, you need LAST-1, LAST-2, and LAST-3
>Why? I can't imagine a good use case for wanting one, two, or
>three days before the end of the month as a special form of date.
To make this work:
date d = January LAST-1; // the 30th
add_month(d);
d == February 27th or 28th depending on the leap year,
add_month(d);
d == March 30th;
Which is why the specialized function is the way to go. LAST isn't enough and anything else is cumbersome, buggy and hard to maintain.
Yours,
-Gary-
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk