• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Chapter 4. Function Invocation and Creation</title>
5<link rel="stylesheet" href="../boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="index.html" title="Boost.Python Reference Manual">
8<link rel="up" href="index.html" title="Boost.Python Reference Manual">
9<link rel="prev" href="object_wrappers/boost_python_tuple_hpp.html" title="boost/python/tuple.hpp">
10<link rel="next" href="function_invocation_and_creation/boost_python_call_hpp.html" title="boost/python/call.hpp">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../images/boost.png"></td></tr></table>
14<hr>
15<div class="spirit-nav">
16<a accesskey="p" href="object_wrappers/boost_python_tuple_hpp.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="index.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="function_invocation_and_creation/boost_python_call_hpp.html"><img src="../images/next.png" alt="Next"></a>
17</div>
18<div class="chapter">
19<div class="titlepage"><div><div><h1 class="title">
20<a name="function_invocation_and_creation"></a>Chapter 4. Function Invocation and Creation</h1></div></div></div>
21<div class="toc">
22<p><b>Table of Contents</b></p>
23<dl class="toc">
24<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp">boost/python/args.hpp</a></span></dt>
25<dd><dl>
26<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction">Introduction</a></span></dt>
27<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg">Class
28        <code class="computeroutput"><span class="identifier">arg</span></code></a></span></dt>
29<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor">Class
30        <code class="computeroutput"><span class="identifier">arg</span></code> constructor</a></span></dt>
31<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_operator">Class
32        <code class="computeroutput"><span class="identifier">arg</span></code> operator=</a></span></dt>
33<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator">Keyword-expression
34        operator,</a></span></dt>
35<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.example">Example</a></span></dt>
36</dl></dd>
37<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html">boost/python/call.hpp</a></span></dt>
38<dd><dl>
39<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html#function_invocation_and_creation.boost_python_call_hpp.introduction">Introduction</a></span></dt>
40<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html#function_invocation_and_creation.boost_python_call_hpp.function_call">Function
41        <code class="computeroutput"><span class="identifier">call</span></code></a></span></dt>
42<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html#function_invocation_and_creation.boost_python_call_hpp.example">Example</a></span></dt>
43</dl></dd>
44<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html">boost/python/call_method.hpp</a></span></dt>
45<dd><dl>
46<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html#function_invocation_and_creation.boost_python_call_method_hpp.introduction">Introduction</a></span></dt>
47<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html#function_invocation_and_creation.boost_python_call_method_hpp.function_call_method">Function
48        <code class="computeroutput"><span class="identifier">call_method</span></code></a></span></dt>
49<dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html#function_invocation_and_creation.boost_python_call_method_hpp.example">Example</a></span></dt>
50</dl></dd>
51<dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html">boost/python/data_members.hpp</a></span></dt>
52<dd><dl>
53<dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html#function_invocation_and_creation.boost_python_data_members_hpp.introduction">Introduction</a></span></dt>
54<dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html#function_invocation_and_creation.boost_python_data_members_hpp.functions">Functions</a></span></dt>
55<dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html#function_invocation_and_creation.boost_python_data_members_hpp.example">Example</a></span></dt>
56</dl></dd>
57<dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html">boost/python/make_function.hpp</a></span></dt>
58<dd><dl>
59<dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html#function_invocation_and_creation.boost_python_make_function_hpp.introduction">Introduction</a></span></dt>
60<dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html#function_invocation_and_creation.boost_python_make_function_hpp.functions">Functions</a></span></dt>
61<dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html#function_invocation_and_creation.boost_python_make_function_hpp.example">Example</a></span></dt>
62</dl></dd>
63<dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html">boost/python/overloads.hpp</a></span></dt>
64<dd><dl>
65<dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.introduction">Introduction</a></span></dt>
66<dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.overloaddispatcher_concept">OverloadDispatcher
67        Concept</a></span></dt>
68<dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.macros">Macros</a></span></dt>
69<dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.example">Example</a></span></dt>
70</dl></dd>
71<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html">boost/python/ptr.hpp</a></span></dt>
72<dd><dl>
73<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.introduction">Introduction</a></span></dt>
74<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.functions">Functions</a></span></dt>
75<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper">Class
76        template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code></a></span></dt>
77<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper_t">Class
78        template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code>
79        types</a></span></dt>
80<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper_c">Class
81        template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code>
82        constructors and destructor</a></span></dt>
83<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper_o">Class
84        template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code>
85        observer functions</a></span></dt>
86<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.metafunctions">Metafunctions</a></span></dt>
87<dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.example">Example</a></span></dt>
88</dl></dd>
89<dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html">boost/python/raw_function.hpp</a></span></dt>
90<dd><dl>
91<dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html#function_invocation_and_creation.boost_python_raw_function_hpp.introduction">Introduction</a></span></dt>
92<dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html#function_invocation_and_creation.boost_python_raw_function_hpp.function_raw_function">Function
93        <code class="computeroutput"><span class="identifier">raw_function</span></code></a></span></dt>
94<dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html#function_invocation_and_creation.boost_python_raw_function_hpp.example">Example</a></span></dt>
95</dl></dd>
96<dt><span class="section"><a href="function_invocation_and_creation/function_documentation.html">Function
97      documentation</a></span></dt>
98<dd><dl>
99<dt><span class="section"><a href="function_invocation_and_creation/function_documentation.html#function_invocation_and_creation.function_documentation.boost_python_function_doc_signat">boost/python/function_doc_signature.hpp</a></span></dt>
100<dt><span class="section"><a href="function_invocation_and_creation/function_documentation.html#function_invocation_and_creation.function_documentation.boost_python_pytype_function_hpp">boost/python/pytype_function.hpp</a></span></dt>
101</dl></dd>
102<dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html">Models
103      of CallPolicies</a></span></dt>
104<dd><dl>
105<dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_default_call_polici">boost/python/default_call_policies.hpp</a></span></dt>
106<dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_return_arg_hpp">boost/python/return_arg.hpp</a></span></dt>
107<dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_return_internal_ref">boost/python/return_internal_reference.hpp</a></span></dt>
108<dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_return_value_policy">boost/python/return_value_policy.hpp</a></span></dt>
109<dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_with_custodian_and_">boost/python/with_custodian_and_ward.hpp</a></span></dt>
110</dl></dd>
111<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconverter.html">Models
112      of ResultConverter</a></span></dt>
113<dd><dl>
114<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconverter.html#function_invocation_and_creation.models_of_resultconverter.boost_python_to_python_indirect_">boost/python/to_python_indirect.hpp</a></span></dt>
115<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconverter.html#function_invocation_and_creation.models_of_resultconverter.boost_python_to_python_value_hpp">boost/python/to_python_value.hpp</a></span></dt>
116</dl></dd>
117<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html">Models
118      of ResultConverterGenerator</a></span></dt>
119<dd><dl>
120<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_copy_const_referenc">boost/python/copy_const_reference.hpp</a></span></dt>
121<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_copy_non_const_refe">boost/python/copy_non_const_reference.hpp</a></span></dt>
122<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_manage_new_object_h">boost/python/manage_new_object.hpp</a></span></dt>
123<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_reference_existing_">boost/python/reference_existing_object.hpp</a></span></dt>
124<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_return_by_value_hpp">boost/python/return_by_value.hpp</a></span></dt>
125<dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_return_opaque_point">boost/python/return_opaque_pointer.hpp</a></span></dt>
126</dl></dd>
127</dl>
128</div>
129<div class="section">
130<div class="titlepage"><div><div><h2 class="title" style="clear: both">
131<a name="function_invocation_and_creation.boost_python_args_hpp"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp" title="boost/python/args.hpp">boost/python/args.hpp</a>
132</h2></div></div></div>
133<div class="toc"><dl class="toc">
134<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction">Introduction</a></span></dt>
135<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg">Class
136        <code class="computeroutput"><span class="identifier">arg</span></code></a></span></dt>
137<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor">Class
138        <code class="computeroutput"><span class="identifier">arg</span></code> constructor</a></span></dt>
139<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_operator">Class
140        <code class="computeroutput"><span class="identifier">arg</span></code> operator=</a></span></dt>
141<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator">Keyword-expression
142        operator,</a></span></dt>
143<dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.example">Example</a></span></dt>
144</dl></div>
145<div class="section">
146<div class="titlepage"><div><div><h3 class="title">
147<a name="function_invocation_and_creation.boost_python_args_hpp.introduction"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction" title="Introduction">Introduction</a>
148</h3></div></div></div>
149<div class="toc"><dl class="toc"><dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction.keyword_expressions">keyword-expressions</a></span></dt></dl></div>
150<p>
151          Supplies a family of overloaded functions for specifying argument keywords
152          for wrapped C++ functions.
153        </p>
154<div class="section">
155<div class="titlepage"><div><div><h4 class="title">
156<a name="function_invocation_and_creation.boost_python_args_hpp.introduction.keyword_expressions"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction.keyword_expressions" title="keyword-expressions">keyword-expressions</a>
157</h4></div></div></div>
158<p>
159            A keyword-expression results in an object which holds a sequence of
160            <a class="link" href="glossary.html#ntbs">ntbs</a>es, and whose type encodes the number
161            of keywords specified. The keyword-expression may contain default values
162            for some or all of the keywords it holds
163          </p>
164</div>
165</div>
166<div class="section">
167<div class="titlepage"><div><div><h3 class="title">
168<a name="function_invocation_and_creation.boost_python_args_hpp.class_arg"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg" title="Class arg">Class
169        <code class="computeroutput"><span class="identifier">arg</span></code></a>
170</h3></div></div></div>
171<p>
172          The objects of class arg are keyword-expressions holding one keyword (
173          size one )
174        </p>
175<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span>
176<span class="special">{</span>
177        <span class="keyword">struct</span> <span class="identifier">arg</span>
178        <span class="special">{</span>
179          <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
180                  <span class="identifier">arg</span> <span class="special">&amp;</span><span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">value</span><span class="special">);</span>
181          <span class="keyword">explicit</span> <span class="identifier">arg</span> <span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span> <span class="special">*</span><span class="identifier">name</span><span class="special">){</span><span class="identifier">elements</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">name</span> <span class="special">=</span> <span class="identifier">name</span><span class="special">;}</span>
182        <span class="special">};</span>
183
184<span class="special">}}</span>
185</pre>
186</div>
187<div class="section">
188<div class="titlepage"><div><div><h3 class="title">
189<a name="function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor" title="Class arg constructor">Class
190        <code class="computeroutput"><span class="identifier">arg</span></code> constructor</a>
191</h3></div></div></div>
192<pre class="programlisting"><span class="identifier">arg</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">name</span><span class="special">);</span></pre>
193<div class="variablelist">
194<p class="title"><b></b></p>
195<dl class="variablelist">
196<dt><span class="term">Requires</span></dt>
197<dd><p>
198                The argument must be a <a class="link" href="glossary.html#ntbs">ntbs</a>.
199              </p></dd>
200<dt><span class="term">Effects</span></dt>
201<dd><p>
202                Constructs an arg object holding a keyword with name name.
203              </p></dd>
204</dl>
205</div>
206</div>
207<div class="section">
208<div class="titlepage"><div><div><h3 class="title">
209<a name="function_invocation_and_creation.boost_python_args_hpp.class_arg_operator"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_operator" title="Class arg operator=">Class
210        <code class="computeroutput"><span class="identifier">arg</span></code> operator=</a>
211</h3></div></div></div>
212<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">arg</span> <span class="special">&amp;</span><span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">value</span><span class="special">);</span></pre>
213<div class="variablelist">
214<p class="title"><b></b></p>
215<dl class="variablelist">
216<dt><span class="term">Requires</span></dt>
217<dd><p>
218                The argument must convertible to python.
219              </p></dd>
220<dt><span class="term">Effects</span></dt>
221<dd><p>
222                Assigns default value for the keyword.
223              </p></dd>
224<dt><span class="term">Returns</span></dt>
225<dd><p>
226                Reference to <code class="computeroutput"><span class="keyword">this</span></code>.
227              </p></dd>
228</dl>
229</div>
230</div>
231<div class="section">
232<div class="titlepage"><div><div><h3 class="title">
233<a name="function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator" title="Keyword-expression operator,">Keyword-expression
234        operator,</a>
235</h3></div></div></div>
236<pre class="programlisting"><span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span> <span class="keyword">operator</span> <span class="special">,</span> <span class="special">(</span><span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">arg</span> <span class="special">&amp;</span><span class="identifier">kw</span><span class="special">)</span> <span class="keyword">const</span>
237<span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span> <span class="keyword">operator</span> <span class="special">,</span> <span class="special">(</span><span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">name</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
238</pre>
239<div class="variablelist">
240<p class="title"><b></b></p>
241<dl class="variablelist">
242<dt><span class="term">Requires</span></dt>
243<dd><p>
244                The argument name must be a <a class="link" href="glossary.html#ntbs">ntbs</a>.
245              </p></dd>
246<dt><span class="term">Effects</span></dt>
247<dd><p>
248                Extends the keyword-expression argument with one more keyword.
249              </p></dd>
250<dt><span class="term">Returns</span></dt>
251<dd><p>
252                The extended keyword-expression.
253              </p></dd>
254</dl>
255</div>
256</div>
257<div class="section">
258<div class="titlepage"><div><div><h3 class="title">
259<a name="function_invocation_and_creation.boost_python_args_hpp.example"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.example" title="Example">Example</a>
260</h3></div></div></div>
261<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">python</span><span class="special">/</span><span class="identifier">def</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
262<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">python</span><span class="special">;</span>
263
264<span class="keyword">int</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">z</span><span class="special">=</span><span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">w</span><span class="special">=</span><span class="number">1.0</span><span class="special">);</span>
265
266<span class="identifier">BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">xxx</span><span class="special">)</span>
267<span class="special">{</span>
268  <span class="identifier">def</span><span class="special">(</span><span class="string">"f"</span><span class="special">,</span> <span class="identifier">f</span><span class="special">,</span> <span class="special">(</span><span class="identifier">arg</span><span class="special">(</span><span class="string">"x"</span><span class="special">),</span> <span class="string">"y"</span><span class="special">,</span> <span class="identifier">arg</span><span class="special">(</span><span class="string">"z"</span><span class="special">)=</span><span class="number">0.0</span><span class="special">,</span> <span class="identifier">arg</span><span class="special">(</span><span class="string">"w"</span><span class="special">)=</span><span class="number">1.0</span><span class="special">));</span>
269<span class="special">}</span>
270</pre>
271</div>
272</div>
273</div>
274<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
275<td align="left"></td>
276<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2015 David Abrahams, Stefan Seefeld<p>
277        Distributed under the Boost Software License, Version 1.0. (See accompanying
278        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>
279      </p>
280</div></td>
281</tr></table>
282<hr>
283<div class="spirit-nav">
284<a accesskey="p" href="object_wrappers/boost_python_tuple_hpp.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="index.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="function_invocation_and_creation/boost_python_call_hpp.html"><img src="../images/next.png" alt="Next"></a>
285</div>
286</body>
287</html>
288