/trunk/Examples/test-suite/template_static.i
Swig | 33 lines | 26 code | 7 blank | 0 comment | 0 complexity | 617dae915e45b3b1230312455b270977 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- %module template_static
- %warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo<int>; /* Ruby, wrong class name */
- %warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo<double>; /* Ruby, wrong class name */
- %inline %{
- template<class T> class foo {
- public:
- static int test;
- };
- template<class T> int foo<T>::test = 0;
- %}
- %template(foo_i) foo<int>;
- %template(foo_d) foo<double>;
- %inline %{
- namespace toto {
- class Foo {
- public:
- template<class T>
- static double bar(int i) {
- return 1.0;
- }
- private:
- int i;
- };
- }
- %}
- %template(bar_double) toto::Foo::bar<double>;