Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Sequence Facade


The sequence_facade template provides an intrusive mechanism for producing a conforming Fusion iterator.


template<typename Derived, typename TravesalTag, typename IsView = mpl::false_>
struct sequence_facade;


The user of sequence_facade derives his sequence type from a specialization of sequence_facade and passes the derived sequence type as the first template parameter. The second template parameter should be the traversal category of the sequence being implemented. The 3rd parameter should be set to mpl::true_ if the sequence is a view.

The user must the implement the key expressions required by their sequence type.




sequence, Seq

A type derived from sequence_facade


An MPL Integral Constant

Table1.92.Key Expressions



sequence::template begin<Seq>::type

The type of an iterator to the beginning of a sequence of type Seq

sequence::template begin<Seq>::call(seq)

An iterator to the beginning of sequence seq

sequence::template end<Seq>::type

The type of an iterator to the end of a sequence of type Seq

sequence::template end<Seq>::call(seq)

An iterator to the end of sequence seq

sequence::template size<Seq>::type

The size of a sequence of type Seq as an MPL Integral Constant

sequence::template size<Seq>::call(seq)

The size of sequence seq

sequence::template at<Seq, N>::type

The type of element N in a sequence of type Seq

sequence::template at<Seq, N>::call(seq)

Element N in sequence seq

sequence::template value_at<Sequence, N>::type

The type of the Nth element in a sequence of type Seq


#include <boost/fusion/sequence/sequence_facade.hpp>
#include <boost/fusion/include/sequence_facade.hpp>


A full working example using sequence_facade is provided in triple.cpp in the extension examples.