Skip to content

Commit

Permalink
Add more docs about _global_ prefix in typemap temporary variables
Browse files Browse the repository at this point in the history
  • Loading branch information
wsfulton committed Dec 6, 2014
1 parent 1509d6c commit 427c511
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Doc/Manual/Typemaps.html
Expand Up @@ -2052,7 +2052,19 @@ <H3><a name="Typemaps_nn23"></a>11.4.2 Declaring new local variables</H3>

<p>There is an exception: if the variable name starts with the <tt>_global_</tt> prefix,
the argument number is not appended. Such variables can be used throughout the generated
wrapper function.</p>
wrapper function. For example, the above typemap could be rewritten to use <tt>_global_temp</tt>
instead of <tt>temp</tt> and the generated code would then contain a single <tt>_global_temp</tt> variable
instead of <tt>temp1</tt>, <tt>temp2</tt> and <tt>temp3</tt>:
</p>

<div class="code">
<pre>
%typemap(in) std::string * <b>(std::string _global_temp)</b> {
... as above ...
}
</pre>
</div>


<p>
Some typemaps do not recognize local variables (or they may simply not
Expand Down

0 comments on commit 427c511

Please sign in to comment.