From a48ccb50a65448acc9bdfd9062a1086cb632ca2e Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 8 Feb 2006 23:00:02 +0000 Subject: [PATCH] well, %rename is working, but not all the languages declare std::vector in the same way git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8753 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../test-suite/ignore_template_constructor.i | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/ignore_template_constructor.i b/Examples/test-suite/ignore_template_constructor.i index 5971f091f..66b44f727 100644 --- a/Examples/test-suite/ignore_template_constructor.i +++ b/Examples/test-suite/ignore_template_constructor.i @@ -1,13 +1,21 @@ %module ignore_template_constructor %include std_vector.i +#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON) || defined(SWIGPERL) +#define SWIG_GOOD_VECTOR %ignore std::vector::vector(size_type); %ignore std::vector::resize(size_type); +#endif +#if defined(SWIGTCL) || defined(SWIGPERL) +#define SWIG_GOOD_VECTOR +/* here, for languages with bad declaration */ +%ignore std::vector::vector(unsigned int); +%ignore std::vector::resize(unsigned int); +#endif +#if defined(SWIG_GOOD_VECTOR) %inline %{ - - class Flow { Flow() {} public: @@ -15,4 +23,17 @@ public: }; %} +#else +/* here, for languages with bad typemaps */ + +%inline %{ +class Flow { +public: + Flow() {} + Flow(double d) {} +}; +%} + +#endif + %template(VectFlow) std::vector;