Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-11-19 05:04:49

On Wed, Nov 19, 2003 at 08:08:57PM +1100, Matthew Wilson wrote:
> > Now that I think about it, a range concept does not even need to be so
> complicated.
> > As explained above (in the original message):
> > - a range is a pair of iterators
> > - it has typedefs for value_type,pointer,reference
> > (no const_pointer,no const_reference)
> > - it's got begin() and end()
> > - it's got an operator bool() that returns true if the
> > range is non-empty.
> I'm still of the opinion that all a range needs is ++(), bool() and *().
> Having said that, begin() and end() are starting to look attractive, from a
> practical pov. Hopefully others can shed light on where in the continuum
> between our ideas they lie. (Perhaps they'll lie outside it! :)

You may be interested to read

and other messages in-that-thread/of-mine from that time period.

In FC++, our "list" type is your kind of "range", only it is spelled

   range fcpp::list
   ----- ----------
   ++i l = tail(l)
   bool(i) bool(l) or !null(l)
   *i head(l)

Brian's non-interesting observation of the day: There seems to be lots
of concept-refactoring and library-interface-redesign going on here at
Boost. Would that we all had design omniscience! We would have saved
ourselves a lot of time! :)

-Brian McNamara (lorgon_at_[hidden])

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