
Hi!
do you mean this?
#include <iostream>
template<class T>
void function_template(T value)
{
std::cout << value << std::endl;
}
struct function_template_wrapper
{
template
consider the following program:
template <typename T> void function_template(T value) { std::cout << __PRETTY_FUNCTION__ << std::endl; }
struct function_template_wrapper { template <typename T> static void call(T value) { function_template<T>(value); } };
int main(int argc, char* argv[]) { int i; function_template_wrapper::call<int>(i); }
Is it possible to somehow parameterize the struct function_template_wrapper such that I can pass function_template as a parameter?
E.g. function_template_wrapper
::call<int>(i); would call function_template<int>(i), and function_template_wrapper ::call<int>(i); would call other_function_template<int>(i) Underlying problem: I want to somehow pass a name of a function template to a class, that will instantiate the function template for a number of types (known at compile time), and store these instantiations in function objects, for later use.
Best regards,
-- Ares Lagae Computer Graphics Research Group, Katholieke Universiteit Leuven http://www.cs.kuleuven.be/~ares/
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users