Template Functions Taking Function Pointer as Argument
Subject: Template Functions Taking Function Pointer as Argument
Newsgroups: gmane.comp.programming.swig
Date: 2008-11-14 05:16:52 GMT
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
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Swig-user mailing list Swig-user <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/swig-user
RSS Feed