Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-11-19 06:28:50

"Brian McNamara" <lorgon_at_[hidden]> wrote in message

> You may be interested to read
> and other messages in-that-thread/of-mine from that time period.

>From thead:
class interval { // a "single iterator" type (and a "concept")
      // conceptually this encapsulates a pair of iterators, first & last
      operator++ // advance (e.g. first++)
      operator* // get element (*first)
      bool isEnd() // the "first==last" concept, easier for
      stl_iterator first() // probably unnecessary
      stl_iterator last() // the lynchpin--see below

I find the idea of having Pavol's iterator_range augemented with
operator*() and operator++ quite nice. isEnd() is equal to
empty() which should be equal to operator bool-something();

It might also be nice with a
constructor that can limit the stored range in some way, eg.

vector<int> v;
iterator_range< ... > r( v ); // [begin(), end() )
iterator_range< ... > r( v, 5, 5 ); // [begin() + 5, end() - 5)

or something


Boost list run by bdawes at, gregod at, cpdaniel at, john at