Files
cpp-thirdparty/winx64/bin/swig-3.0.12/Examples/test-suite/smart_pointer_overload.i
Bassem Girgis 81b4b9e273 Initial commit
2018-12-20 17:34:07 -06:00

29 lines
497 B
OpenEdge ABL

%module smart_pointer_overload
#ifdef SWIGLUA // lua only has one numeric type, so some overloads shadow each other creating warnings
%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) test;
#endif
#ifndef SWIG_NO_OVERLOAD
%inline %{
struct Foo {
int x;
int test(int y) { y = 0; return 1; }
int test(double y) { y = 0; return 2; }
int test(char *s) { s = 0; return 3; }
};
class Bar {
Foo *f;
public:
Bar(Foo *f) : f(f) { }
Foo *operator->() {
return f;
}
};
%}
#endif