blob: e90244f3e45d4026626364dc06389918d4af8be1 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
<!-- Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 1st August 2002), see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - &lt;boost/python/tuple.hpp&gt;</title>
</head>
<body>
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277"
alt="C++ Boost" src="../../../../boost.png" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center"><a href="../index.html">Boost.Python</a></h1>
<h2 align="center">Header &lt;boost/python/tuple.hpp&gt;</h2>
</td>
</tr>
</table>
<hr>
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a></dt>
<dt><a href="#classes">Classes</a></dt>
<dd>
<dl class="page-index">
<dt><a href="#tuple-spec">Class <code>tuple</code></a></dt>
<dd>
<dl class="page-index">
<dt><a href="#tuple-spec-synopsis">Class <code>tuple</code>
synopsis</a></dt>
</dl>
</dd>
</dl>
</dd>
<dt><a href="#functions">Functions</a></dt>
<dd>
<dl class="page-index">
<dt><a href="#make_tuple-spec"><code>make_tuple</code></a></dt>
</dl>
</dd>
<dt><a href="#examples">Example</a></dt>
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<p>Exposes a <a href=
"ObjectWrapper.html#TypeWrapper-concept">TypeWrapper</a> for the Python
<a href=
"http://www.python.org/doc/current/tut/node7.html#SECTION007300000000000000000">
tuple</a> type.</p>
<h2><a name="classes"></a>Classes</h2>
<h3><a name="tuple-spec"></a>Class <code>tuple</code></h3>
<p>Exposes the interface of Python's built-in <code>tuple</code> type.
The semantics of the constructors and member functions defined below can
be fully understood by reading the <a href=
"ObjectWrapper.html#TypeWrapper-concept">TypeWrapper</a> concept
definition. Since <code>tuple</code> is publicly derived from <code><a
href="object.html#object-spec">object</a></code>, the public object
interface applies to <code>tuple</code> instances as well.</p>
<h4><a name="tuple-spec-synopsis"></a>Class <code>tuple</code>
synopsis</h4>
<pre>
namespace boost { namespace python
{
class tuple : public object
{
// tuple() -&gt; an empty tuple
tuple();
// tuple(sequence) -&gt; tuple initialized from sequence's items
template &lt;class T&gt;
explicit tuple(T const&amp; sequence)
};
}}
</pre>
<h2><a name="functions"></a>Functions</h2>
<h3><a name="make_tuple-spec"></a><code>make_tuple</code></h3>
<pre>
namespace boost { namespace python
{
tuple make_tuple();
template &lt;class A0&gt;
tuple make_tuple(A0 const&amp; a0);
template &lt;class A0, class A1&gt;
tuple make_tuple(A0 const&amp; a0, A1 const&amp; a1);
...
template &lt;class A0, class A1,...class A<i>n</i>&gt;
tuple make_tuple(A0 const&amp; a0, A1 const&amp; a1,...A<i>n</i> const&amp; a<i>n</i>);
}}
</pre>
Constructs a new tuple object composed of <code>object(a0),
object(a0),...object(a<i>n</i>)</code>.
<h2><a name="examples"></a>Example</h2>
<pre>
using namespace boost::python;
tuple head_and_tail(object sequence)
{
return make_tuple(sequence[0],sequence[-1]);
}
</pre>
<p>Revised 03 October, 2002</p>
<p><i>&copy; Copyright <a href=
"http://www.boost.org/people/dave_abrahams.htm">Dave Abrahams</a> 2002.</i></p>
</body>
</html>