boost::mpl::transform_view

# transform_view

### Synopsis

    template<
          typename Sequence
        , typename F
        >
    struct transform_view
    {
        // unspecified
    };

### Description

`transform_view` is a sequence wrapper that allows one to operate on the transformed sequence without actually creating one.

### Definition

    #include "boost/mpl/transform_view.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`Sequence` | A model of Sequence | A sequence to wrap.
`F` | A model of unary [Lambda Expression] | A transformation metafunction.

### Expression semantics

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`.

### Complexity

Amortized constant time.

### Example

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);

### See also

Sequences, `filter_view`, `joint_view`, `zip_view`, `max_element`

Table of Contents
Last edited March 10, 2003 4:43 am