2002-09-16 19:25:33 +00:00
<!doctype html public "-//ietf//dtd html//en">
2003-03-12 13:29:12 +00:00
< html >< head >< title > boost::mpl::transform_view</ title >
2002-09-16 19:25:33 +00:00
< link rel = "stylesheet" href = "../mpl_wiki.css" >
</ head >< body bgcolor = "white" >
2003-03-12 13:29:12 +00:00
< h1 >< a href = "../Table_of_Contents.html" >< img src = "../mpl_logo.jpg" alt = "[Home]" border = 0 align = "right" ></ a > transform_view</ h1 >< h3 > Synopsis</ h3 >
2002-09-16 19:25:33 +00:00
< p >
< pre >
template<
typename Sequence
, typename F
>
struct transform_view
{
2003-03-12 13:29:12 +00:00
< span class = "cxx-comment" > // unspecified</ span >
2002-09-16 19:25:33 +00:00
};
</ pre >
< p >
< h3 > Description</ h3 >
< p >
< code > transform_view</ code > is a sequence wrapper that allows one to operate on the transformed sequence without actually creating one.
< p >
< h3 > Definition</ h3 >
< p >
< pre >
2003-03-12 13:29:12 +00:00
#include "< a href = "../../../../../boost/mpl/transform_view.hpp" > boost/mpl/transform_view.hpp</ a > "
2002-09-16 19:25:33 +00:00
</ pre >
< p >
< h3 > Parameters</ h3 >
< table border = "1" >
< tr >< th > Parameter </ th >< th > Requirement </ th >< th > Description </ th ></ tr >
< tr >< td >< code > Sequence</ code ></ td >< td > A model of < a href = "../Sequence.html" > Sequence</ a ></ td >< td > A sequence to wrap. </ td ></ tr >
< tr >< td >< code > F</ code ></ td >< td > A model of unary [Lambda Expression]</ td >< td > A transformation metafunction. </ td ></ tr >
</ table >
< p >
< h3 > Expression semantics</ h3 >
< p >
< table border = "1" >
< tr >< th > Expression </ th >< th > Expression type </ th >< th > Precondition </ th >< th > Semantics </ th >< th > Postcondition </ th ></ tr >
< tr >< td >< code > typedef transform_view< Sequence,F> s;</ code ></ td >< td > A model of < a href = "../Sequence.html" > Sequence</ a ></ td >< td ></ td >< td >< code > s</ code > is a sequence such that for each < code > i</ code > in < code > [< a href = "../Reference/begin.html" > begin</ a > < s> ::type, < a href = "../Reference/end.html" > end</ a > < s> ::type)</ code > and for each < code > j</ code > in < code > [< a href = "../Reference/begin.html" > begin</ a > < Sequence> ::type, < a href = "../Reference/end.html" > end</ a > < Sequence> ::type)</ code > < code > i::type</ code > is identical to < code > apply< lambda< F> ::type, j::type > ::type</ code > .</ td >< td >< code >< a href = "../Reference/size.html" > size</ a > < Sequence> ::type::value == < a href = "../Reference/size.html" > size</ a > < s> ::type::value</ code > . </ td ></ tr >
</ table >
< p >
< h3 > Complexity</ h3 >
< p >
Amortized constant time.
< p >
< h3 > Example</ h3 >
< p >
Finds the largest type in a sequence.
< p >
< pre >
typedef < a href = "../Reference/list.html" > list</ a > < int,long,char,char[50],double> types;
2003-03-12 13:29:12 +00:00
typedef < a href = "../Reference/max_element.html" > max_element</ a > <
2002-09-16 19:25:33 +00:00
transform_view< types, size_of< _> >
> ::type iter;
BOOST_STATIC_ASSERT(iter::type::value == 50);
</ pre >
< p >
< h3 > See also</ h3 >
< p >
2003-03-12 13:29:12 +00:00
< a href = "../Sequences.html" > Sequences</ a > , < code >< a href = "../Reference/filter_view.html" > filter_view</ a ></ code > , < code >< a href = "../Reference/joint_view.html" > joint_view</ a ></ code > , < code >< a href = "../Reference/zip_view.html" > zip_view</ a ></ code > , < code >< a href = "../Reference/max_element.html" > max_element</ a ></ code >
2002-09-16 19:25:33 +00:00
< p >< hr >
2003-03-12 13:29:12 +00:00
< a href = "../Table_of_Contents.html" > Table of Contents</ a >< br > Last edited March 10, 2003 4:43 am</ body ></ html >