Back to Arangodb

transform_view

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/transform-view.html

3.12.9.13.2 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Views / transform_view |

transform_view

Synopsis

template<
      typename Sequence
    , typename F
    >
struct[transform\_view](./transform-view.html){
    //_unspecified_//_..._};

Description

A view the full range of Sequence's transformed elements.

#include <[boost/mpl/transform\_view.hpp](../../../../boost/mpl/transform_view.hpp)>

Model of

Parameters

ParameterRequirementDescription
SequenceForward SequenceA sequence to wrap.
FUnary Lambda ExpressionA transformation.

Expression semantics

The semantics of an expression are defined only where they differ from, or are not defined in Forward Sequence.

In the following table, v is an instance of transform_view, s is an arbitrary Forward Sequence, and f is an unary Lambda Expression.

ExpressionSemantics
[transform\_view](./transform-view.html)<s,f>[transform\_view](./transform-view.html)<s,f>::type

| A lazy Forward Sequence such that for each i in the range [begin<v>::type, end<v>::type) and each j in for in the range [begin<s>::type, end<s>::type) deref<i>::type is identical to apply< f, deref<j>::type >::type. | | size<v>::type | The size of v; size<v>::value == size<s>::value; linear complexity; see Forward Sequence. |

Example

Find the largest type in a sequence.

typedef[vector](./vector.html)<int,long,char,char[50],double> types;
typedef[max\_element](./max-element.html)<[transform\_view](./transform-view.html)< types, size_of<_> >
    >::type iter;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([deref](./deref.html)<iter>::type::value, ==, 50 );

See also

Sequences, Views, filter_view, joint_view, zip_view, iterator_range

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |