transform_view
template<
typename Sequence
, typename F
>
struct transform_view
{
// unspecified
};
transform_viewは,新しいシーケンスを作らずに,変換されたシーケンスへの演算を可能にする,
シーケンスのラッパである.
#include "boost/mpl/transform_view.hpp"
| Parameter | Requirement | Description |
|---|---|---|
Sequence | シーケンスのモデル | ラップするシーケンス |
F | 単項[ラムダ式]のモデル | 変換メタ関数 |
| 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::type が
apply< lambda<F>::type, j::type >::type
と同一であるようなシーケンスである.
| size<Sequence>::type::value == size<s>::type::value. |
償却定数時間
シーケンスから最大の型を見つける.
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