Suzanne Vogel wrote:
Is it possible to store a pointer to a template function?
eg,
template<class T> fooFunc() {...}
[ptr_to_template_function] fptr = fooFunc; // <--
...
Strictly speaking, 'fooFunc' is not a template function. It is a
function template. It is not possible to have a pointer to function
template. However, once the template is specialized it becomes ordinary
function and you can create a pointer to it.
There are different ways to specialize a function template. It can be
done by explicit specification of template arguments. Or it can be done
implicitly by compiler (template argument deduction). In fact, when you
do something like this
SomePtrToFunctionType fptr = fooFunc;
(where 'fooFunc' is a function template) the compiler will attempt to
perform template argument deduction based on the target type
('SomePtrToFunctionType') in order to obtain compatible specialization
of 'fooFunc' template.
But again, even if it works, if creates a pointer to a concrete
specialization of the template, not to the function template itself.
There is no such thing in C++ as 'pointer to template'.
--
Best regards,
Andrey Tarasevich