From: charlie <cha...@gm...> - 2008-11-14 05:16:55
|
Hi swig-users, I am trying to wrap up a template function which take a template function pointer as argument. Is the following interface file and header file correct way? test.i: %module test %{ #include "test.h" %} %include"test.h" %template(fab) TF<A, B>(A, B&, B (*f)(const A&), int n) test.h: class A { /* .. */ } class B { /* .. */ } class E { /*... */ } B f( A& ) {/* ... */} template <class C, class D> E TF(C, D&, D (*f)(const D&), int n) { /*...*/ } Then in python I supposed to use fab by following: >>> import test >>> a=A() >>> b=B() >>> e=fab(a, b, &f, 10) Am I right? I tested my header file and implicit deduction using c++. They all went through good. However in SWIG, I see stranger erorr like "symbol undifiened: blahblah" Your help is greatly appreciated. Thanks Charlie |