To-Be-Proposed Boost Sequences Library

Abstract

This library under development is a re-think of the ideas we've used to represent sequences in C++: containers, iterators, and Ranges.

The Sequence Concept

Sequence is an abstraction that bundles two Cursors and a Property Map.[1] In the table below, S is a model of Sequence and x is a (possibly cv-qualified) instance of S.

Sequence Requirements
Valid Expression Type Semantics
boost::sequence::elements(s)
boost::result_of<
    boost::sequence::end::id(S const&)
>::type
Returns a Property Map that accesses the elements of x. If x is writable, the result is a model of Writable Property Map.
boost::sequence::begin(x)
boost::result_of<
  boost::sequence::begin::id(S const&)
>::type
Returns a Cursor that, when used with the elements property map, traverses the elements of x.
boost::sequence::end(x)
boost::result_of<
  boost::sequence::end::id(S const&)
>::type
Returns a suitble Cursor for terminating the traversal of x.
[1]We realize the standard has already used the term “sequence,” but there are few reasonable terms left and the standard's concept is weak and seldom used.