import source from 1.3.40
[external/swig.git] / Examples / test-suite / smart_pointer_overload.i
1 %module smart_pointer_overload
2
3 #ifdef SWIGLUA  // lua only has one numeric type, so some overloads shadow each other creating warnings
4 %warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) test;
5 #endif
6
7 #ifndef SWIG_NO_OVERLOAD
8
9 %inline %{
10 struct Foo {
11    int x;
12    int test(int y) { y = 0; return 1; }
13    int test(double y) { y = 0; return 2; }
14    int test(char *s) { s = 0; return 3; }
15 };
16
17 class Bar {
18    Foo *f;
19 public:
20    Bar(Foo *f) : f(f) { }
21    Foo *operator->() {
22       return f;
23    }
24 };
25 %}
26
27 #endif
28