1 %module smart_pointer_simple 2 3 %inline %{ 4 struct Foo { 5 int x; getxFoo6 int getx() { return x; } 7 }; 8 9 class Bar { 10 Foo *f; 11 public: Bar(Foo * f)12 Bar(Foo *f) : f(f) { } 13 Foo *operator->() { 14 return f; 15 } 16 }; 17 %} 18 19 20