...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template<
typename Sequence
, typename F
>
struct transform_view
{
// unspecified
};
transform_view
is a sequence wrapper that allows one to operate on the transformed sequence without actually creating one.
#include "boost/mpl/transform_view.hpp"
Parameter | Requirement | Description |
---|---|---|
Sequence | A model of Sequence | A sequence to wrap. |
F | A model of unary [Lambda Expression] | A transformation metafunction. |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef transform_view<Sequence,F> s; | A model of Sequence | s is a sequence such that for each i in [begin<s>::type, end<s>::type) and for each j in [begin<Sequence>::type, end<Sequence>::type) i::type is identical to apply< lambda<F>::type, j::type >::type . | size<Sequence>::type::value == size<s>::type::value . |
Amortized constant time.
Finds the largest type in a sequence.
typedef list<int,long,char,char[50],double> types; typedef max_element< transform_view< types, size_of<_> > >::type iter; BOOST_STATIC_ASSERT(iter::type::value == 50);
Sequences, filter_view
, joint_view
, zip_view
, max_element