From: Marcelo M. <mar...@us...> - 2006-02-08 23:00:14
|
Update of /cvsroot/swig/SWIG/Examples/test-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1697 Modified Files: ignore_template_constructor.i Log Message: well, %rename is working, but not all the languages declare std::vector in the same way Index: ignore_template_constructor.i =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/test-suite/ignore_template_constructor.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ignore_template_constructor.i 8 Feb 2006 22:41:49 -0000 1.2 --- ignore_template_constructor.i 8 Feb 2006 23:00:02 -0000 1.3 *************** *** 2,18 **** %include std_vector.i %ignore std::vector<Flow>::vector(size_type); %ignore std::vector<Flow>::resize(size_type); %inline %{ class Flow { - Flow() {} public: Flow(double d) {} }; %} %template(VectFlow) std::vector<Flow>; --- 2,39 ---- %include std_vector.i + #if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON) || defined(SWIGPERL) + #define SWIG_GOOD_VECTOR %ignore std::vector<Flow>::vector(size_type); %ignore std::vector<Flow>::resize(size_type); + #endif + #if defined(SWIGTCL) || defined(SWIGPERL) + #define SWIG_GOOD_VECTOR + /* here, for languages with bad declaration */ + %ignore std::vector<Flow>::vector(unsigned int); + %ignore std::vector<Flow>::resize(unsigned int); + #endif + #if defined(SWIG_GOOD_VECTOR) %inline %{ + class Flow { + Flow() {} + public: + Flow(double d) {} + }; + %} + #else + /* here, for languages with bad typemaps */ + %inline %{ class Flow { public: + Flow() {} Flow(double d) {} }; %} + #endif + %template(VectFlow) std::vector<Flow>; |