aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/smart_pointer_simple.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/smart_pointer_simple.i')
-rw-r--r--Examples/test-suite/smart_pointer_simple.i19
1 files changed, 19 insertions, 0 deletions
diff --git a/Examples/test-suite/smart_pointer_simple.i b/Examples/test-suite/smart_pointer_simple.i
new file mode 100644
index 000000000..ceb499c41
--- /dev/null
+++ b/Examples/test-suite/smart_pointer_simple.i
@@ -0,0 +1,19 @@
+%module smart_pointer_simple
+
+%inline %{
+struct Foo {
+ int x;
+ int getx() { return x; }
+};
+
+class Bar {
+ Foo *f;
+public:
+ Bar(Foo *f) : f(f) { }
+ Foo *operator->() {
+ return f;
+ }
+};
+%}
+
+