From: David Abrahams (dave_at_[hidden])
Date: 2004-04-30 14:57:23
Roland Richter <roland_at_[hidden]> writes:
> Neal Becker wrote:
>> I like your suggestion, Roland. Here is my adaptation (I will have to add
>> credits and copyright later).
>> It counts wraps as you suggest. I found it easier to implement and
>> understand by basing it on an integral offset from a base. It all becomes
>> pretty simple by calculating a "realposition" which is
>> wraps*size+position. This is like a virtual index into an infinitely
>> long sequence.
> Definitely, this solution is elegant and better readable. Plus, it
> passes the test I use for cyclic_iterator (in the sandbox) after
> a minor modification:
> For unknown reason, MSVC chokes on
> typename std::iterator_traits<BaseIterator>::value_type
> twice ('iterator_category' : is not a member of 'operator``global amespace'''),
> but accepts
> typename boost::iterator_value<BaseIterator>::type
Right. iterator_value uses boost::iterator_traits, which contains
bajillions of workarounds for vc6/7 inadequacies.
> I suggest to add your implementation to Boost.Iterator! Does this
> require a review, or mini review, if there is something like that?
A review would help, but isn't strictly neccessary. It requires at
least some extra confidence on my part. If cycle_iterator is
thoroughly tested, including concept checks, and the documentation is
readable and complete, that will go a long way. I don't know the
current status of these things...
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk