If you have a templated class or a templated function, (or combination of the two), how do you bind that function, (preserving the template type parameter)?
I was gi
If I understood you right... :)
What you want to do is not possible because for template
To overcome that we can use boost::variant<> to either store pointers to different types of functions or to store arguments of functions.
template void foo(T);
typedef boost::variant func_ptr_variant;
std::vector v;
v.push_back(foo);
v.push_back(foo);
typedef boost::variant argument;
std::vector
Unfortunately, in any case you will need to instantiate function templates before inserting them to container because C++ can not do code generation on the fly. I think that it is possible that you know all possible types of arguments that the function may be used with so that may be not a problem.