From: Marcelo M. <mm...@ac...> - 2006-02-03 15:59:44
|
Hmmm, well, this form is working at least: ------------------------------------------------------------- %module example %feature("ignore") std::vector<Flow>::vector(size_type); %inline %{ namespace std { template<class T> class vector { public: typedef size_t size_type; vector() {} vector(size_type n) { T t = T(); } }; } class Flow { Flow() {} public: Flow(double d) {} }; %} %template(VectFlow) std::vector<Flow>; ---------------------------------------------------------- we will have to recheck this thing in the next release I guess. Marcelo SourceForge.net wrote: >Bugs item #1204342, was opened at 2005-05-18 15:03 >Message generated for change (Comment added) made by wsfulton >You can respond by visiting: >https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1204342&group_id=1645 > >Please note that this message will contain a full copy of the comment thread, >including the initial issue submission, for this request, >not just the latest update. >Category: code generation (general) >Group: None > > >>Status: Open >> >> >Resolution: Fixed >Priority: 5 >Submitted By: William Fulton (wsfulton) > > >>Assigned to: Marcelo Matus (marcelomatus) >> >> >Summary: %ignore template constructors not working > >Initial Comment: >email trail... > >Yes checked all of this plus many more ordering >combinations. Looks like a real bug. > >William > > > >>-----Original Message----- >>From: Marcelo Matus [mailto:mm...@ac...] >>Sent: 26 April 2005 19:41 >>To: Fulton, William >>Cc: swi...@cs... >>Subject: Re: [Swig-dev] %ignore template constructors >> >> >>Did you try reversing the order?, ie >> >><>class Test { >>public: >>Test(double d) {} >>}; >> >>%ignore std::vector<Test>::vector(unsigned int); >>%template(VectTest) std::vector<Test>; >> >>also, check that the constructor is really using >> >> >'unsigned int' instead > > >>of 'size_t' or plain 'int', just in case. >> >> >>Wil...@ub... wrote: >> >> >> >>>Anyone come across %ignore failing to ignore template >>> >>> >>constructors? The following should ignore the >> >> >specified vector > > >>constructor, which is needed because there is no default >>constructor in the Test class. >> >> >>>%module example >>> >>>%ignore std::vector<Test>::vector(unsigned int); >>>%include "std_vector.i" >>> >>>%{ >>> class Test { >>> public: >>> Test(double d) {} >>> }; >>>%} >>> >>>%template(VectTest) std::vector<Test>; >>> >>>class Test { >>> public: >>> Test(double d) {} >>>}; >>> >>> >>>Strangely, if the vector type is a primitive, like int, >>> >>> >>instead of Test, then the %ignore will work. Also >> >> >%exception > > >>works which is odd as both %exception and %ignore are >> >> >really a > > >>%feature. >> >> >>>William >>> >>> >>> > > >---------------------------------------------------------------------- > > > >>Comment By: William Fulton (wsfulton) >> >> >Date: 2006-02-03 13:01 > >Message: >Logged In: YES >user_id=242951 > >Still not fixed for me and is a show stopper for 1.3.28 due >to changes in std::vector declaration in Java/C#. Here is a >cut down example... > >%module example > >//%feature("ignore") >std::vector<Flow>::vector(std::vector<Flow>::size_type); >%ignore std::vector<Flow>::vector(std::vector<Flow>::size_type); >//%feature("ignore") std::vector<Flow>::vector(size_t); > >%inline %{ > >namespace std { > > template<class T> class vector { > public: > typedef size_t size_type; > vector() {} > vector(size_type n) { T t = T(); } > }; >} > >class Flow { > Flow() {} >public: > Flow(double d) {} >}; >%} > >%template(VectFlow) std::vector<Flow>; > > > >---------------------------------------------------------------------- > >Comment By: Marcelo Matus (marcelomatus) >Date: 2005-12-30 09:19 > >Message: >Logged In: YES >user_id=246059 > >New fixes for rename/features fix this problem. > >Marcelo > > >---------------------------------------------------------------------- > >Comment By: Marcelo Matus (marcelomatus) >Date: 2005-12-06 20:12 > >Message: >Logged In: YES >user_id=246059 > >Aja!, nope %ignore is not a feature > >Use > >%feature("ignore") std::vector<Test>::vector(unsigned int); > >instead. > >Marcelo > >---------------------------------------------------------------------- > >You can respond by visiting: >https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1204342&group_id=1645 > > |