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