Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-04-14 15:28:34


From: "Powell, Gary" <powellg_at_[hidden]>
> 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;

Ummm, OK, you made it work, but why? Why would you want to be
able to call add_month() on a date and have it always represent
the day before the last day of the month?

> 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.

I don't see why you need more than LAST thus far. If there is a
good use case for this idea that has general appeal, then I agree
with you, it becomes quite cumbersome. However, does that mean
that LAST itself isn't valuable? Put another way, if there is
value in LAST-1 et al, how often would they be wanted relative to
the desire for LAST?

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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