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. All names are in namespace boost unless otherwise specified.

Sequence Requirements
Valid Expression Type Semantics
sequence::elements(s)
result_of<
    sequence::id::elements(S&)
>::type
Returns a Property Map that accesses the elements of x. If x is writable, the result is a model of Writable Property Map.
sequence::begin(x)
result_of<
    sequence::id::begin(S&)
>::type
Returns a Cursor that, when used with the elements property map, traverses the elements of x.
sequence::end(x)
result_of<
    sequence::id::end(S&)
>::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.