
20 Apr
2004
20 Apr
'04
7:59 a.m.
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