/tags/rel-1-3-26/SWIG/Examples/test-suite/enum_template.i
Swig | 43 lines | 18 code | 8 blank | 17 comment | 0 complexity | 0b1f9a8a837f300b7959df101fc5aa2b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1%module enum_template 2 3%warnfilter(801) eTest0; /* Ruby, wrong class name */ 4%warnfilter(801) eTest1; /* Ruby, wrong class name */ 5%warnfilter(801) eTest2; /* Ruby, wrong class name */ 6 7/* 8From bug report 992329: 9 10In Python I see 11 12>>> import enum_template 13>>> enum_template.MakeETest() 14'_60561408_p_ETest' 15>>> enum_template.TakeETest(0) 16Traceback (most recent call last): 17File "<stdin>", line 1, in ? 18TypeError: Expected a pointer 19 20Without the %template, things work fine: the first 21function call returns an integer, and the second 22succeeds. 23*/ 24 25%inline %{ 26 27enum ETest 28{ 29eTest0, 30eTest1, 31eTest2 32}; 33 34void TakeETest(ETest test) {}; 35ETest MakeETest(void) {return eTest1;}; 36 37template<class T> class CTempl 38{ 39}; 40 41%} 42 43%template(CTempl_ETest) CTempl<ETest>;