File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -76,3 +76,18 @@ void do_nothing(TemplTricky<int>) {};
76
76
%}
77
77
78
78
%template (TemplTrickyInt) myns::TemplTricky<int >;
79
+
80
+ // Test autofree declaration *before* including std:string
81
+ %fortran_autofree_rvalue(std::string)
82
+ namespace std {
83
+ class string {
84
+ };
85
+ }
86
+
87
+ %include <std_string.i>
88
+
89
+ %inline %{
90
+ std::string str_value (std::string s) { return s; }
91
+ const std::string& str_cref (const std::string& s) { return s; }
92
+ std::string& str_ref (std::string& s) { return s; }
93
+ %}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class string;
32
32
33
33
/* ---- CONST REFERENCE: NATIVE STRING ---- */
34
34
35
+ %clear const std::string &;
35
36
%typemap(ctype) const std::string & = char *;
36
37
%typemap(imtype) const std::string & = char *;
37
38
%typemap(ftype) const std::string & = char *;
@@ -57,6 +58,7 @@ class string;
57
58
58
59
/* ---- VALUE: NATIVE STRING ---- */
59
60
61
+ %clear std::string;
60
62
%apply const std::string & { std::string };
61
63
62
64
%typemap(globalin) std::string {
You can’t perform that action at this time.
0 commit comments