[Home]transform_view

Synopsis

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

詳細

transform_viewは,新しいシーケンスを作らずに,変換されたシーケンスへの演算を可能にする, シーケンスのラッパである.

Definition

#include "boost/mpl/transform_view.hpp"

Parameters

 Parameter  Requirement  Description  
Sequenceシーケンスのモデルラップするシーケンス
F単項[ラムダ式]のモデル変換メタ関数

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef transform_view<Sequence,F> s;A model of Sequence s[begin<s>::type, end<s>::type) の中のそれぞれの i と, [begin<Sequence>::type, end<Sequence>::type) の中のそれぞれの j において, i::typeapply< lambda<F>::type, j::type >::type と同一であるようなシーケンスである. size<Sequence>::type::value == size<s>::type::value.

Complexity

償却定数時間

Example

シーケンスから最大の型を見つける.

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