...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 the implement the key expressions required by their iterator type.
Table 1.93. Parameters
Name |
Description |
---|---|
|
A type derived from |
|
Table 1.94. 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 |
|
The distance between iterators of type |
|
|
The distance between iterators |
|
#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.