Boost logo

Boost :

From: Janusz Piwowarski (jpiw_at_[hidden])
Date: 2004-04-20 02:59:01


Rob Stewart writes:
> >
> > d.allow_clipping_to_eom() + 2*months;
> > d.disallow_clipping_to_eom() + 2*months;
>
> That would require modifying the date class to add new mfs for
> each style, right?

Right

> > or
> >
> > allow_clipping_to_eom(d) + 2*months;
> > disallow_clipping_to_eom(d) + 2*months;
> >
> > where adding months to date directly isn't allowed.
>
> That sounds like an excellent approach. Not only might the
> library provide one or more such date wrappers and factory
> functions, but this provides a clear usage pattern that custom
> wrappers can follow.
>

Yes, it's possible to create rules like

dont_stop_on_sunday(d) + 14*days

Janusz


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