...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
flatten_view
presents a view
which iterates over its elements recursively in depth-first order.
#include <boost/fusion/view/flatten_view.hpp> #include <boost/fusion/include/flatten_view.hpp>
template <typename Sequence> struct flatten_view;
Parameter |
Description |
Default |
---|---|---|
|
Notation
F
A flatten_view
type
s
An instance of Sequence
f
, f2
Instances of F
Semantics of an expression is defined only where it differs from, or is not defined in Forward Sequence.
Expression |
Semantics |
---|---|
|
Creates a |
|
Copy constructs a |
|
Assigns to a |
typedefvector
<int, int,vector
<int, int>, int> sequence_type; sequence_type seq;flatten_view
<sequence_type> flattened(seq);copy
(make_vector
(1, 2, 3, 4, 5), flattened); assert(seq ==make_vector
(1, 2,make_vector
(3, 4), 5));