/trunk/Examples/test-suite/smart_pointer_typedef.i

# · Swig · 21 lines · 16 code · 5 blank · 0 comment · 0 complexity · 774d10c28cf4d6ec50c67152db9aab49 MD5 · raw file

  1. %module smart_pointer_typedef
  2. %inline %{
  3. struct Foo {
  4. int x;
  5. int getx() { return x; }
  6. };
  7. typedef Foo *FooPtr;
  8. class Bar {
  9. Foo *f;
  10. public:
  11. Bar(Foo *f) : f(f) { }
  12. FooPtr operator->() {
  13. return f;
  14. }
  15. };
  16. %}