Boost logo

Boost :

From: nbecker_at_[hidden]
Date: 2002-01-29 08:24:07


>>>>> "David" == David Abrahams <david.abrahams_at_[hidden]> writes:

    David> ----- Original Message -----
    David> From: <nbecker_at_[hidden]>
    David> To: <boost_at_[hidden]>
    David> Sent: Tuesday, January 29, 2002 8:03 AM
    David> Subject: [boost] Help with iterator helpers

>> I'm trying to learn to use iterator helpers, but I need a little
>> help. The only example I found I don't understand. Maybe I need a
>> more basic example.
>>
>> I'm trying a simple example. The class "fifo" has a circular buffer
>> with seperate read and write pointers. I'd like to implement
>> begin_r(), end_r(), begin_w(), and end_w() which will give appropriate
>> iterators for read and write.
>>
>> BTW, here is fifo:

    David> ...and your question would be...? ;^)

I was hoping to find a simpler example. One thing not clear to me is
the first template parameter T. It says "operand type". In the
example, it is set to "test_iter<T,R,P>", which is a self-reference.
I'm confused.

    David> FWIW, most people find the iterator helpers aren't that useful now that we
    David> have the iterator adaptor library. It does a lot more to automate the job of
    David> making correct and useful iterators.

I'll have a look. I thought the adaptors were, well, adaptors. In
this case, I'm not adapting an existing iterator, but making a new
one, so I didn't think that the adaptors were applicable.


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