Files
boost_fusion/doc/html/fusion/tuples/class_template_tuple/construction.html
Tobias Schwinger ca6f831b96 adds documentation for functional module
[SVN r36959]
2007-02-15 23:11:24 +00:00

129 lines
8.3 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Construction</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="../../../index.html" title="Chapter 1. Fusion 2.0">
<link rel="up" href="../class_template_tuple.html" title="Class template tuple">
<link rel="prev" href="../class_template_tuple.html" title="Class template tuple">
<link rel="next" href="tuple_creation_functions.html" title="Tuple
creation functions">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.htm">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="../../../../../../../people/people.htm">People</a></td>
<td align="center"><a href="../../../../../../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../class_template_tuple.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../class_template_tuple.html"><img src="../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../images/home.png" alt="Home"></a><a accesskey="n" href="tuple_creation_functions.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="fusion.tuples.class_template_tuple.construction"></a><a href="construction.html" title="Construction">Construction</a></h4></div></div></div>
<a name="fusion.tuples.class_template_tuple.construction.description"></a><h5>
<a name="id1175601"></a>
<a href="construction.html#fusion.tuples.class_template_tuple.construction.description">Description</a>
</h5>
<p>
The <a href="http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1403.pdf" target="_top">TR1
Tuple</a> type provides a default constructor, a constructor that takes
initializers for all of its elements, a copy constructor, and a converting
copy constructor. The details of the various constructors are described
in this section.
</p>
<a name="fusion.tuples.class_template_tuple.construction.specification"></a><h5>
<a name="id1175636"></a>
<a href="construction.html#fusion.tuples.class_template_tuple.construction.specification">Specification</a>
</h5>
<div class="variablelist">
<p class="title"><b>Notation</b></p>
<dl>
<dt><span class="term"><code class="computeroutput"><span class="identifier">T1</span>
<span class="special">...</span> <span class="identifier">TN</span></code>,
<code class="computeroutput"><span class="identifier">U1</span> <span class="special">...</span>
<span class="identifier">UN</span></code></span></dt>
<dd>
Tuple element types
</dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">P1</span>
<span class="special">...</span> <span class="identifier">PN</span></code></span></dt>
<dd>
Parameter types
</dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">Ti</span></code>,
<code class="computeroutput"><span class="identifier">Ui</span></code></span></dt>
<dd>
The type of the <code class="computeroutput"><span class="identifier">i</span></code>th element
of a tuple
</dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">Pi</span></code></span></dt>
<dd>
The type of the <code class="computeroutput"><span class="identifier">i</span></code>th parameter
</dd>
</dl>
</div>
<pre class="programlisting">
<span class="identifier">tuple</span><span class="special">();</span>
</pre>
<p>
<span class="bold"><strong>Requirements</strong></span>: Each <code class="computeroutput"><span class="identifier">Ti</span></code>
is default constructable.
</p>
<p>
<span class="bold"><strong>Semantics</strong></span>: Default initializes each element
of the tuple.
</p>
<pre class="programlisting">
<span class="identifier">tuple</span><span class="special">(</span><span class="identifier">P1</span><span class="special">,</span><span class="identifier">P2</span><span class="special">,...,</span><span class="identifier">PN</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requirements</strong></span>: Each <code class="computeroutput"><span class="identifier">Pi</span></code>
is <code class="computeroutput"><span class="identifier">Ti</span></code> if <code class="computeroutput"><span class="identifier">Ti</span></code> is a reference type, <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">Ti</span><span class="special">&amp;</span></code> otherwise.
</p>
<p>
<span class="bold"><strong>Semantics</strong></span>: Copy initializes each element
with the corresponding parameter.
</p>
<pre class="programlisting">
<span class="identifier">tuple</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">tuple</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requirements</strong></span>: Each <code class="computeroutput"><span class="identifier">Ti</span></code>
should be copy constructable.
</p>
<p>
<span class="bold"><strong>Semantics</strong></span>: Copy constructs each element
of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
with the corresponding element of <code class="computeroutput"><span class="identifier">t</span></code>.
</p>
<pre class="programlisting">
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">U2</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">UN</span><span class="special">&gt;</span>
<span class="identifier">tuple</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">UN</span><span class="special">&gt;&amp;</span> <span class="identifier">t</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requirements</strong></span>: Each <code class="computeroutput"><span class="identifier">Ti</span></code>
shall be constructible from the corresponding <code class="computeroutput"><span class="identifier">Ui</span></code>.
</p>
<p>
<span class="bold"><strong>Semantics</strong></span>: Constructs each element of
<code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
with the corresponding element of <code class="computeroutput"><span class="identifier">t</span></code>.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright © 2001-2005 Joel de Guzman, Dan Marsden</small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../class_template_tuple.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../class_template_tuple.html"><img src="../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../images/home.png" alt="Home"></a><a accesskey="n" href="tuple_creation_functions.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>