|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
function template uses templated header - swig interface fileHow does one create the swig interface file for a function (in a separate file) that uses a templated header file? ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Swig-user mailing list Swig-user@... https://lists.sourceforge.net/lists/listinfo/swig-user |
|
|
Re: function template uses templated header - swig interface fileRubin, Jared wrote:
> How does one create the swig interface file for a function (in a > separate file) that uses a templated header file? > My Bar.C uses a template instance of Foo.h. I am not seeing the code > being wrapped correctly > Thanks > > > # A function template that uses a class template > Foo.h > ============== > template <class T> class Foo { > private: > T* data; > public Foo(T *d) > { > data = t; > } > } > > Bar.h > ================= > #include "Foo.h" > void bar(Foo<int> f); > > Bar.C > ================= > #include "Bar.h" > void bar(Foo<int> f) { > // do something; > return; > } > > FooBar.i > ========= > %module FooBar > %include "Foo.h" > %template(FooI) Foo<int>; > %include "Bar.h" > that it compiles, it should generate wrappers, although you'd have a SWIGTYPE_p_int type wrapper class which isn't great. See the docs for improving the wrapping pointers to primitive types. William ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ Swig-user mailing list Swig-user@... https://lists.sourceforge.net/lists/listinfo/swig-user |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |