Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/doc/v2/tuple.html @ 45

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

updated boost from 1_33_1 to 1_34_1

File size: 4.0 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
4<!-- Software License, Version 1.0. (See accompanying -->
5<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
6<html>
7  <head>
8    <meta name="generator" content=
9    "HTML Tidy for Windows (vers 1st August 2002), see www.w3.org">
10    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
11    <link rel="stylesheet" type="text/css" href="../boost.css">
12
13    <title>Boost.Python - &lt;boost/python/tuple.hpp&gt;</title>
14  </head>
15
16  <body>
17    <table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
18    "header">
19      <tr>
20        <td valign="top" width="300">
21          <h3><a href="../../../../index.htm"><img height="86" width="277"
22          alt="C++ Boost" src="../../../../boost.png" border="0"></a></h3>
23        </td>
24
25        <td valign="top">
26          <h1 align="center"><a href="../index.html">Boost.Python</a></h1>
27
28          <h2 align="center">Header &lt;boost/python/tuple.hpp&gt;</h2>
29        </td>
30      </tr>
31    </table>
32    <hr>
33
34    <h2>Contents</h2>
35
36    <dl class="page-index">
37      <dt><a href="#introduction">Introduction</a></dt>
38
39      <dt><a href="#classes">Classes</a></dt>
40
41      <dd>
42        <dl class="page-index">
43          <dt><a href="#tuple-spec">Class <code>tuple</code></a></dt>
44
45          <dd>
46            <dl class="page-index">
47              <dt><a href="#tuple-spec-synopsis">Class <code>tuple</code>
48              synopsis</a></dt>
49            </dl>
50          </dd>
51        </dl>
52      </dd>
53
54      <dt><a href="#functions">Functions</a></dt>
55
56      <dd>
57        <dl class="page-index">
58          <dt><a href="#make_tuple-spec"><code>make_tuple</code></a></dt>
59        </dl>
60      </dd>
61
62      <dt><a href="#examples">Example</a></dt>
63    </dl>
64    <hr>
65
66    <h2><a name="introduction"></a>Introduction</h2>
67
68    <p>Exposes a <a href=
69    "ObjectWrapper.html#TypeWrapper-concept">TypeWrapper</a> for the Python
70    <a href=
71    "http://www.python.org/doc/current/tut/node7.html#SECTION007300000000000000000">
72    tuple</a> type.</p>
73
74    <h2><a name="classes"></a>Classes</h2>
75
76    <h3><a name="tuple-spec"></a>Class <code>tuple</code></h3>
77
78    <p>Exposes the interface of Python's built-in <code>tuple</code> type.
79    The semantics of the constructors and member functions defined below can
80    be fully understood by reading the <a href=
81    "ObjectWrapper.html#TypeWrapper-concept">TypeWrapper</a> concept
82    definition. Since <code>tuple</code> is publicly derived from <code><a
83    href="object.html#object-spec">object</a></code>, the public object
84    interface applies to <code>tuple</code> instances as well.</p>
85
86    <h4><a name="tuple-spec-synopsis"></a>Class <code>tuple</code>
87    synopsis</h4>
88<pre>
89namespace boost { namespace python
90{
91   class tuple : public object
92   {
93      // tuple() -&gt; an empty tuple
94      tuple();
95
96      // tuple(sequence) -&gt; tuple initialized from sequence's items
97      template &lt;class T&gt;
98      explicit tuple(T const&amp; sequence)
99  };
100}}
101</pre>
102
103    <h2><a name="functions"></a>Functions</h2>
104
105    <h3><a name="make_tuple-spec"></a><code>make_tuple</code></h3>
106<pre>
107namespace boost { namespace python
108{
109  tuple make_tuple();
110
111  template &lt;class A0&gt;
112  tuple make_tuple(A0 const&amp; a0);
113
114  template &lt;class A0, class A1&gt;
115  tuple make_tuple(A0 const&amp; a0, A1 const&amp; a1);
116  ...
117  template &lt;class A0, class A1,...class A<i>n</i>&gt; 
118  tuple make_tuple(A0 const&amp; a0, A1 const&amp; a1,...A<i>n</i> const&amp; a<i>n</i>);
119}}
120</pre>
121    Constructs a new tuple object composed of <code>object(a0),
122    object(a0),...object(a<i>n</i>)</code>.
123
124    <h2><a name="examples"></a>Example</h2>
125<pre>
126using namespace boost::python;
127tuple head_and_tail(object sequence)
128{
129    return make_tuple(sequence[0],sequence[-1]);
130}
131</pre>
132
133    <p>Revised 03 October, 2002</p>
134
135    <p><i>&copy; Copyright <a href=
136    "../../../../people/dave_abrahams.htm">Dave Abrahams</a> 2002.</i></p>
137  </body>
138</html>
139
Note: See TracBrowser for help on using the repository browser.