aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/smart_pointer_overload.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/smart_pointer_overload.i')
-rw-r--r--Examples/test-suite/smart_pointer_overload.i24
1 files changed, 24 insertions, 0 deletions
diff --git a/Examples/test-suite/smart_pointer_overload.i b/Examples/test-suite/smart_pointer_overload.i
new file mode 100644
index 000000000..ffc2097be
--- /dev/null
+++ b/Examples/test-suite/smart_pointer_overload.i
@@ -0,0 +1,24 @@
+%module smart_pointer_overload
+
+#ifndef SWIG_NO_OVERLOAD
+
+%inline %{
+struct Foo {
+ int x;
+ int test(int x) { x = 0; return 1; }
+ int test(double x) { x = 0; return 2; }
+ int test(char *s) { s = 0; return 3; }
+};
+
+class Bar {
+ Foo *f;
+public:
+ Bar(Foo *f) : f(f) { }
+ Foo *operator->() {
+ return f;
+ }
+};
+%}
+
+#endif
+