From: Kris T. <kri...@gm...> - 2012-01-31 09:57:17
|
Hi Jim > > If I have multiple templated functions with the same name and same > template parameters, but different signatures, is there any way to > instantiate those templates with different types? > > Here's an example: > > template <typename T> > struct int_thing; > > template <typename T> > struct float_thing; > > template <typename T> > void func(int_thing<T> * t); > > template <typename T> > void func(float_thing<T> * t); > > I'd like to do the %template equivalent of the following C++ explicit > instantiations: > > template void func(int_thing<int> *); > template void func(int_thing<long> *); > > template void func(float_thing<float> *); > template void func(float_thing<double> *); > > Is there any way to do this? > > I'm confused. You can use %template for multiple types for classes, e.g. %template(IntVector) vector<int>; %template(DoubleVector) vector<double>; Why does this not work for you? If you're getting an error, it'd be good to include your swig code and error log. Kris |