| 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: single_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="./joint-view.html" class="navigation-link">Prev</a> <a href="./transform-view.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./joint-view.html" class="navigation-link">Back</a> <a href="./transform-view.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./views.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </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="./single-view.html" class="navigation-link">single_view</a></td> |
|---|
| 16 | </tr></table><div class="header-separator"></div> |
|---|
| 17 | <div class="section" id="single-view"> |
|---|
| 18 | <h1><a class="toc-backref" href="./views.html#id349" name="single-view">single_view</a></h1> |
|---|
| 19 | <div class="section" id="single-synopsis"> |
|---|
| 20 | <h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3> |
|---|
| 21 | <pre class="literal-block"> |
|---|
| 22 | template< |
|---|
| 23 | typename T |
|---|
| 24 | > |
|---|
| 25 | struct <a href="./single-view.html" class="identifier">single_view</a> |
|---|
| 26 | { |
|---|
| 27 | // <em>unspecified</em> |
|---|
| 28 | // <em>...</em> |
|---|
| 29 | }; |
|---|
| 30 | </pre> |
|---|
| 31 | </div> |
|---|
| 32 | <div class="section" id="single-description"> |
|---|
| 33 | <h3><a class="subsection-title" href="#description" name="description">Description</a></h3> |
|---|
| 34 | <p>A view onto an arbitrary type <tt class="literal"><span class="pre">T</span></tt> as on a single-element sequence.</p> |
|---|
| 35 | </div> |
|---|
| 36 | <div class="section" id="single-header"> |
|---|
| 37 | <h3><a class="subsection-title" href="#header" name="header">Header</a></h3> |
|---|
| 38 | <pre class="literal-block"> |
|---|
| 39 | #include <<a href="../../../../boost/mpl/single_view.hpp" class="header">boost/mpl/single_view.hpp</a>> |
|---|
| 40 | </pre> |
|---|
| 41 | </div> |
|---|
| 42 | <div class="section" id="single-model-of"> |
|---|
| 43 | <h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3> |
|---|
| 44 | <ul class="simple"> |
|---|
| 45 | <li><a class="reference" href="./random-access-sequence.html">Random Access Sequence</a></li> |
|---|
| 46 | </ul> |
|---|
| 47 | </div> |
|---|
| 48 | <div class="section" id="single-parameters"> |
|---|
| 49 | <h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3> |
|---|
| 50 | <table border="1" class="table"> |
|---|
| 51 | <colgroup> |
|---|
| 52 | <col width="19%" /> |
|---|
| 53 | <col width="23%" /> |
|---|
| 54 | <col width="58%" /> |
|---|
| 55 | </colgroup> |
|---|
| 56 | <thead valign="bottom"> |
|---|
| 57 | <tr><th>Parameter</th> |
|---|
| 58 | <th>Requirement</th> |
|---|
| 59 | <th>Description</th> |
|---|
| 60 | </tr> |
|---|
| 61 | </thead> |
|---|
| 62 | <tbody valign="top"> |
|---|
| 63 | <tr><td><tt class="literal"><span class="pre">T</span></tt></td> |
|---|
| 64 | <td>Any type</td> |
|---|
| 65 | <td>The type to be wrapped in a sequence.</td> |
|---|
| 66 | </tr> |
|---|
| 67 | </tbody> |
|---|
| 68 | </table> |
|---|
| 69 | </div> |
|---|
| 70 | <div class="section" id="single-expression-semantics"> |
|---|
| 71 | <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3> |
|---|
| 72 | <p>The semantics of an expression are defined only |
|---|
| 73 | where they differ from, or are not defined in <a class="reference" href="./random-access-sequence.html">Random Access Sequence</a>.</p> |
|---|
| 74 | <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="./single-view.html" class="identifier">single_view</a></span></tt>, <tt class="literal"><span class="pre">x</span></tt> is an arbitrary type.</p> |
|---|
| 75 | <table border="1" class="table"> |
|---|
| 76 | <colgroup> |
|---|
| 77 | <col width="34%" /> |
|---|
| 78 | <col width="66%" /> |
|---|
| 79 | </colgroup> |
|---|
| 80 | <thead valign="bottom"> |
|---|
| 81 | <tr><th>Expression</th> |
|---|
| 82 | <th>Semantics</th> |
|---|
| 83 | </tr> |
|---|
| 84 | </thead> |
|---|
| 85 | <tbody valign="top"> |
|---|
| 86 | <tr><td><pre class="first last literal-block"> |
|---|
| 87 | <a href="./single-view.html" class="identifier">single_view</a><x> |
|---|
| 88 | <a href="./single-view.html" class="identifier">single_view</a><x>::type |
|---|
| 89 | </pre> |
|---|
| 90 | </td> |
|---|
| 91 | <td>A single-element <a class="reference" href="./random-access-sequence.html">Random Access Sequence</a> <tt class="literal"><span class="pre">v</span></tt> such that |
|---|
| 92 | <tt class="literal"><span class="pre"><a href="./front.html" class="identifier">front</a><v>::type</span></tt> is identical to <tt class="literal"><span class="pre">x</span></tt>.</td> |
|---|
| 93 | </tr> |
|---|
| 94 | <tr><td><tt class="literal"><span class="pre"><a href="./size.html" class="identifier">size</a><v>::type</span></tt></td> |
|---|
| 95 | <td>The size of <tt class="literal"><span class="pre">v</span></tt>; <tt class="literal"><span class="pre"><a href="./size.html" class="identifier">size</a><v>::value</span> <span class="pre">==</span> <span class="pre">1</span></tt>; |
|---|
| 96 | see <a class="reference" href="./random-access-sequence.html">Random Access Sequence</a>.</td> |
|---|
| 97 | </tr> |
|---|
| 98 | </tbody> |
|---|
| 99 | </table> |
|---|
| 100 | </div> |
|---|
| 101 | <div class="section" id="single-example"> |
|---|
| 102 | <h3><a class="subsection-title" href="#example" name="example">Example</a></h3> |
|---|
| 103 | <pre class="literal-block"> |
|---|
| 104 | typedef <a href="./single-view.html" class="identifier">single_view</a><int> view; |
|---|
| 105 | typedef <a href="./begin.html" class="identifier">begin</a><view>::type first; |
|---|
| 106 | typedef <a href="./end.html" class="identifier">end</a><view>::type last; |
|---|
| 107 | |
|---|
| 108 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./deref.html" class="identifier">deref</a><first>::type,int > )); |
|---|
| 109 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./next.html" class="identifier">next</a><first>::type,last > )); |
|---|
| 110 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./prior.html" class="identifier">prior</a><last>::type,first > )); |
|---|
| 111 | |
|---|
| 112 | <a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./size.html" class="identifier">size</a><view>::value, ==, 1 ); |
|---|
| 113 | </pre> |
|---|
| 114 | </div> |
|---|
| 115 | <div class="section" id="single-see-also"> |
|---|
| 116 | <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3> |
|---|
| 117 | <p><a class="reference" href="./sequences.html">Sequences</a>, <a class="reference" href="./views.html">Views</a>, <a class="refentry reference" href="./iterator-range.html"><tt class="refentry literal"><span class="pre">iterator_range</span></tt></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="./transform-view.html"><tt class="refentry literal"><span class="pre">transform_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></p> |
|---|
| 118 | <!-- modtime: November 13, 2004 01:12:56 +0000 --> |
|---|
| 119 | <!-- Sequences/Views//transform_view --> |
|---|
| 120 | </div> |
|---|
| 121 | </div> |
|---|
| 122 | |
|---|
| 123 | <div class="footer-separator"></div> |
|---|
| 124 | <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./joint-view.html" class="navigation-link">Prev</a> <a href="./transform-view.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./joint-view.html" class="navigation-link">Back</a> <a href="./transform-view.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./views.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
|---|
| 125 | </tr></table></body> |
|---|
| 126 | </html> |
|---|