|
Boost : |
From: Chris Trengove (trengove_at_[hidden])
Date: 2003-08-14 21:36:52
"Jeff Garland" <jeff_at_[hidden]> wrote in message
news:20030812114756.M49204_at_crystalclearsoftware.com...
> Another user has submitted a change to me, that hasn't made it into
> the library, that performs the equivalent by modifying
adjust_functors.hpp.
> Looking back on the history of the number of requests on this it looks
like
> it should be a priority to officially support this option. Or perhaps,
even
> better, to step up and support bi-directional or random access iterators.
I think the big issue in using random access iterators is whether you want
to support the difference concept. It is relatively straightforward to
implement, say
year_iterator i(date(2003,1,1));
year_iterator j(date(2005,1,1));
cout << j - i; // prints "2"
but how do you handle the case when the dates are not neatly aligned on the
places where the iterator would normally put them?
I have one more question/suggestion.
Your period concept supports the merge (ie. union) function, which returns
an empty period if there is no intersection. I also have a need for a
function returning the actual [earliest,latest) of the two periods,
regardless of whether they intersect. Obviously, this is trival to write,
but it would be nice if the concept was included in the library.
Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk