Ares Lagae wrote:
Ovanes Markarian wrote:
Hi!
do you mean this?
function_template_wrapper::call
(10); Thanks for the reply, but it's not really what I want.
So you're looking for something like template template parameters for function templates? As you probably know, there is no such language feature. However, it's common practice to use function objects for the use case you describe: // A Function Object struct my_func { template<typename T> void operator()(T const &) const { // [...] } typedef void result_type; // It's also possible to use a result type that // depends on T. Further reading: // http://www.boost.org/libs/utility/utility.htm#result_of }; Now you can pass objects of that type to another function template, or just pass the type 'my_func' to a class template as template argument (for generic components it's usually a good idea to provide a way to initialize the object - maybe a default argument in the ctor, otherwise valid types are restricted to be DefaultConstructible and users can't set an initial state). You can also stuff such an object into a Boost.Function, hard-wiring it towards a certain signature in order to call it from anywhere (such as another translation unit where the type of the function object is unknown). Regards, Tobias