29 May
2007
29 May
'07
5:20 p.m.
Just a small addition to my example:
I was unsure if compiler will deduce the type of the function param without explicit template
specialization. At least MSVC 8 did it. Hope this is so by C++ standard. Here is the example:
include <iostream>
template<class T>
void function_template(T value)
{
std::cout << value << std::endl;
}
template<class T>
void other_function_template(T value)
{
std::cout << value*value << std::endl;
}
struct function_template_wrapper
{
template