I have templated function connect:
template<class InstanceClass>
CL_Slot connect (InstanceClass *instance, void(InstanceClass::*function)(Param1, Param2))
It connects for some signal passed function from InstanceClass.
In my example, I want to connect some of classes for the keyboard event (KeyDown).
In c++ I write:
get_signal_object().connect(&SomeClass::func);
But I have to use this function in python-script with exporting from c++ code (using boost.python).
As I know, to export template I have to export it passing any used type. But in python I’ll pass classes which exist only in python-namespace.
So, any ideas how to use that function templated in python?
Why don’t you just add
note: extern might need to after
template<>— don’t rememberIf you must have C linkage add a wrapper function (it will inline the templated function).
Note: MSVC has nonstandard template export facilities
c++0x has upcoming support for extern templates: http://en.wikipedia.org/wiki/C%2B%2B0x#Extern_template