How do I make the method name (here some_method
) a template parameter?
template
void sv_set_helper(T& d, bpn::array const&
There is no such thing as a 'template identifier parameter', so you can't pass names as parameters. You could however take a member function pointer as argument:
template
void sv_set_helper(T& d, bpn::array const& v) {
to_sv(v, ( d.*SomeMethod )());
}
that's assuming the function has a void
return type. And you will call it like this:
sv_set_helper< SomeT, &SomeT::some_method >( someT, v );