Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-07-08 12:54:14


On 07/08/2005 09:47 AM, Thorsten Ottosen wrote:
> Larry Evans <cppljevans <at> cox-internet.com> writes:
>
>
>>I suspect I missed something, but it's not obvious,
>>at least to me :(
>
>
> 1. range_iterator<X> is nothing but a metafunction for an iterator.
> it returns an iterator type. period. So there is no i.empty() that
> makes sense.

OK. I did try using iterator_range<X>; however, that didn't have
operator++; so, I'm stuck with using Torjo's rangelib. Hopefully
it will be adopted into boost.

>
> 2. the range lib does not have support for "for_each-style iteration".
> use Eric's FOREACH macro for that.
>

Unfortunately, that won't work since I need the iterator to form part
of another iterator, as shown in the previously mentioned
fields_visitor.hpp file, where Torjo's crange is used
to form part of an offset_field_iterator:

 
http://cvs.sourceforge.net/viewcvs.py/boost-sandbox/boost-sandbox/boost/fields_visitor/fields_visitor.hpp?rev=1.4&view=auto

This file shows an attempt to use the current boost::iterator_range;
however, as mentioned above, there's no operator++. As you can
see from looking at the code, FOREACH won't work either since,
there's no operator applied to each element of the iteration,
intead, each element of the iteration is used to form an element
a "higher-level" iterator.


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