From: Val Samko (boost_at_[hidden])
Date: 2004-04-13 18:42:52
Tuesday, April 13, 2004, 11:25:52 PM, you wrote:
>> Do you actually need such a functionality in any applications?
RS> No. The point I was making is that were I to call such a
RS> function, that's the behavior I'd expect. Does not having a
RS> current need for it make it less valid?
I think it does. One could think of 10 other behaviours
of add_month, starting from the random day of the next month, but
they would be nothing but useless. And I can not imagine any
real use for the add_month behaviour you have described.
RS> It isn't mathematical, by which I meant predictable, without
RS> accounting for whether the day of the current month is available
RS> in the subsequent month. That is, yours may fall back anywhere
RS> from zero to three days. Mine is certain to advance to the same
RS> day of the month or exactly 30 days beyond the start; that's far
RS> more predictable.
Predictable? It is definitely not predictable. I think, most people
expect that after
d2 = add_month(add_month(d1, 1), -1)
d1 and d2 are in the same month. And your definition breaks this
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk