Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/refmanual/transform-view.html @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 9.3 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost -->
5<!-- Software License, Version 1.0. (See accompanying -->
6<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
7<head>
8<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9<meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
10<title>The MPL Reference Manual: transform_view</title>
11<link rel="stylesheet" href="../style.css" type="text/css" />
12</head>
13<body class="docframe refmanual">
14<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./single-view.html" class="navigation-link">Prev</a>&nbsp;<a href="./zip-view.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./single-view.html" class="navigation-link">Back</a>&nbsp;<a href="./zip-view.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./views.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
15<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./sequences.html" class="navigation-link">Sequences</a> / <a href="./views.html" class="navigation-link">Views</a> / <a href="./transform-view.html" class="navigation-link">transform_view</a></td>
16</tr></table><div class="header-separator"></div>
17<div class="section" id="transform-view">
18<h1><a class="toc-backref" href="./views.html#id350" name="transform-view">transform_view</a></h1>
19<div class="section" id="transform-synopsis">
20<h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3>
21<pre class="literal-block">
22template&lt;
23      typename Sequence
24    , typename F
25    &gt;
26struct <a href="./transform-view.html" class="identifier">transform_view</a>
27{
28    // <em>unspecified</em>
29    // <em>...</em>
30};
31</pre>
32</div>
33<div class="section" id="transform-description">
34<h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
35<p>A view the full range of <tt class="literal"><span class="pre">Sequence</span></tt>'s transformed elements.</p>
36</div>
37<div class="section" id="transform-header">
38<h3><a class="subsection-title" href="#header" name="header">Header</a></h3>
39<pre class="literal-block">
40#include &lt;<a href="../../../../boost/mpl/transform_view.hpp" class="header">boost/mpl/transform_view.hpp</a>&gt;
41</pre>
42</div>
43<div class="section" id="transform-model-of">
44<h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3>
45<ul class="simple">
46<li><a class="reference" href="./forward-sequence.html">Forward Sequence</a></li>
47</ul>
48</div>
49<div class="section" id="transform-parameters">
50<h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3>
51<table border="1" class="table">
52<colgroup>
53<col width="19%" />
54<col width="40%" />
55<col width="40%" />
56</colgroup>
57<thead valign="bottom">
58<tr><th>Parameter</th>
59<th>Requirement</th>
60<th>Description</th>
61</tr>
62</thead>
63<tbody valign="top">
64<tr><td><tt class="literal"><span class="pre">Sequence</span></tt></td>
65<td><a class="reference" href="./forward-sequence.html">Forward Sequence</a></td>
66<td>A sequence to wrap.</td>
67</tr>
68<tr><td><tt class="literal"><span class="pre">F</span></tt></td>
69<td>Unary <a class="reference" href="./lambda-expression.html">Lambda Expression</a></td>
70<td>A transformation.</td>
71</tr>
72</tbody>
73</table>
74</div>
75<div class="section" id="transform-expression-semantics">
76<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
77<p>The semantics of an expression are defined only
78where they differ from, or are not defined in <a class="reference" href="./forward-sequence.html">Forward Sequence</a>.</p>
79<p>In the following table, <tt class="literal"><span class="pre">v</span></tt> is an instance of <tt class="literal"><span class="pre"><a href="./transform-view.html" class="identifier">transform_view</a></span></tt>, <tt class="literal"><span class="pre">s</span></tt> is an arbitrary
80<a class="reference" href="./forward-sequence.html">Forward Sequence</a>, and <tt class="literal"><span class="pre">f</span></tt> is an unary <a class="reference" href="./lambda-expression.html">Lambda Expression</a>.</p>
81<table border="1" class="table">
82<colgroup>
83<col width="37%" />
84<col width="63%" />
85</colgroup>
86<thead valign="bottom">
87<tr><th>Expression</th>
88<th>Semantics</th>
89</tr>
90</thead>
91<tbody valign="top">
92<tr><td><pre class="first last literal-block">
93<a href="./transform-view.html" class="identifier">transform_view</a>&lt;s,f&gt;
94<a href="./transform-view.html" class="identifier">transform_view</a>&lt;s,f&gt;::type
95</pre>
96</td>
97<td>A lazy <a class="reference" href="./forward-sequence.html">Forward Sequence</a> such that for each <tt class="literal"><span class="pre">i</span></tt> in the
98range [<tt class="literal"><span class="pre"><a href="./begin.html" class="identifier">begin</a>&lt;v&gt;::type</span></tt>, <tt class="literal"><span class="pre"><a href="./end.html" class="identifier">end</a>&lt;v&gt;::type</span></tt>) and each <tt class="literal"><span class="pre">j</span></tt> in for in the range
99[<tt class="literal"><span class="pre"><a href="./begin.html" class="identifier">begin</a>&lt;s&gt;::type</span></tt>, <tt class="literal"><span class="pre"><a href="./end.html" class="identifier">end</a>&lt;s&gt;::type</span></tt>) <tt class="literal"><span class="pre"><a href="./deref.html" class="identifier">deref</a>&lt;i&gt;::type</span></tt> is identical to
100<tt class="literal"><span class="pre"><a href="./apply.html" class="identifier">apply</a>&lt;</span> <span class="pre">f,</span> <span class="pre"><a href="./deref.html" class="identifier">deref</a>&lt;j&gt;::type</span> <span class="pre">&gt;::type</span></tt>.</td>
101</tr>
102<tr><td><tt class="literal"><span class="pre"><a href="./size.html" class="identifier">size</a>&lt;v&gt;::type</span></tt></td>
103<td>The size of <tt class="literal"><span class="pre">v</span></tt>;
104<tt class="literal"><span class="pre"><a href="./size.html" class="identifier">size</a>&lt;v&gt;::value</span> <span class="pre">==</span> <span class="pre"><a href="./size.html" class="identifier">size</a>&lt;s&gt;::value</span></tt>;
105linear complexity; see <a class="reference" href="./forward-sequence.html">Forward Sequence</a>.</td>
106</tr>
107</tbody>
108</table>
109</div>
110<div class="section" id="transform-example">
111<h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
112<p>Find the largest type in a sequence.</p>
113<pre class="literal-block">
114typedef <a href="./vector.html" class="identifier">vector</a>&lt;int,long,char,char[50],double&gt; types;
115typedef <a href="./max-element.html" class="identifier">max_element</a>&lt;
116      <a href="./transform-view.html" class="identifier">transform_view</a>&lt; types, size_of&lt;_&gt; &gt;
117    &gt;::type iter;
118
119<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./deref.html" class="identifier">deref</a>&lt;iter&gt;::type::value, ==, 50 );
120</pre>
121</div>
122<div class="section" id="transform-see-also">
123<h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
124<p><a class="reference" href="./sequences.html">Sequences</a>, <a class="reference" href="./views.html">Views</a>, <a class="refentry reference" href="./filter-view.html"><tt class="refentry literal"><span class="pre">filter_view</span></tt></a>, <a class="refentry reference" href="./joint-view.html"><tt class="refentry literal"><span class="pre">joint_view</span></tt></a>, <a class="refentry reference" href="./zip-view.html"><tt class="refentry literal"><span class="pre">zip_view</span></tt></a>, <a class="refentry reference" href="./iterator-range.html"><tt class="refentry literal"><span class="pre">iterator_range</span></tt></a></p>
125<!-- modtime: November 13, 2004 18:16:44 +0000 -->
126<!-- Sequences/Views//zip_view -->
127</div>
128</div>
129
130<div class="footer-separator"></div>
131<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./single-view.html" class="navigation-link">Prev</a>&nbsp;<a href="./zip-view.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./single-view.html" class="navigation-link">Back</a>&nbsp;<a href="./zip-view.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./views.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
132</tr></table></body>
133</html>
Note: See TracBrowser for help on using the repository browser.