...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The iterator_facade
template provides an intrusive mechanism for producing a conforming Fusion
iterator.
template<typename Derived, typename TravesalTag> struct iterator_facade;
The user of iterator_facade derives his iterator type from a specialization of iterator_facade and passes the derived iterator type as the first template parameter. The second template parameter should be the traversal category of the iterator being implemented.
The user must implement the key expressions required by their iterator type.
Table 1.108. Parameters
Name |
Description |
---|---|
|
A type derived from |
|
Table 1.109. Key Expressions
Expression |
Result |
Default |
---|---|---|
|
The element stored at iterator position |
None |
|
The type returned when dereferencing an iterator of type |
None |
|
Dereferences iterator |
None |
|
The type of the next element from |
None |
|
The next iterator after |
None |
|
The type of the next element from |
None |
|
The next iterator after |
None |
|
The type of an iterator advanced |
Implemented in terms of |
|
An iterator advanced |
Implemented in terms of |
|
The distance between iterators of type |
None |
|
The distance between iterator |
None |
|
Returns |
|
|
Returns a type convertible to |
|
|
The key type associated with the element from |
None |
|
The type of the data property associated with the element from
|
None |
|
The type that will be returned by dereferencing the data property
of the element from |
None |
|
Deferences the data property associated with the element referenced
by |
None |
#include <boost/fusion/iterator/iterator_facade.hpp> #include <boost/fusion/include/iterator_facade.hpp>
A full working example using iterator_facade
is provided in triple.cpp
in the extension examples.