From 427c5112e725a9d9be1e337d75e39d56dc392c0e Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 6 Dec 2014 21:49:42 +0000 Subject: [PATCH] Add more docs about _global_ prefix in typemap temporary variables --- Doc/Manual/Typemaps.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html index e4da514bb..040244d45 100644 --- a/Doc/Manual/Typemaps.html +++ b/Doc/Manual/Typemaps.html @@ -2052,7 +2052,19 @@ wrap_foo() {

There is an exception: if the variable name starts with the _global_ prefix, the argument number is not appended. Such variables can be used throughout the generated -wrapper function.

+wrapper function. For example, the above typemap could be rewritten to use _global_temp +instead of temp and the generated code would then contain a single _global_temp variable +instead of temp1, temp2 and temp3: +

+ +
+
+%typemap(in) std::string * (std::string _global_temp) {
+ ... as above ...
+}
+
+
+

Some typemaps do not recognize local variables (or they may simply not