Boost logo

Boost :

From: Val Samko (boost_at_[hidden])
Date: 2004-04-13 14:50:53


Tuesday, April 13, 2004, 4:46:11 PM, you wrote:

RS> I didn't say just add 30 days. I said I'd expect it to be the
RS> same day of the month in the following month and if there is no
RS> such day in that month, then I'd expect it to be 30 days ahead.

Do you actually need such a functionality in any applications?

RS> Now, one might argue that adding a month should just be adding 30
RS> days then, but that is already possible. I see add_month() as
RS> the means to get closer to the human notion of getting the same
RS> day of the next month, with a clear, mathematical fallback.
falling back to the last day of the month is a perfect "mathematical"
fallback as well. It's just a matter of documentation.

>> Anyway, what other variations do you propose, which can not be
>> achieved by just adding N days?

RS> I don't know what other variations may arise. We've already seen
RS> two, so distinct but clear names already seem warranted.

I understand this if you actually need the functionality you described
in any applications. Otherwise, I'd hate to type
add_month_or_fallback_to_last_day each time I need this simple
operation.

Val Samko
http://val.digiways.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk