|
Boost : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2003-05-29 08:10:15
> I was just repeating myself here, I guess. I was basically saying it would
> be nice to be able to adjust big units (like months) backwards by small
> units (like days).
Well, you can take the iterator content and then do calculation with the
date:
...
date d = *date_itr;
date d2 = d - date_duration(1);
> I will look at your examples and see if I can see how to accomplish what I
> want to do with them. Also, I undersand why something like the month
> iterator cannot be a model of Biderectional Iterator (as it would violate
> the semantic meaning in some cases), but is there a reason why the date
> iterator itself is not bidrectional?
The date_iterator could be bidirectional and others have requested this
capability so it is now on my todo list. Another user has used a negative
duration in the meantime to all for backwards iteration. This works, but
be careful with it as it is not part of the normal tests at the moment.
Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk