Sorry for the inconvenience. I was trying to make it easier to read
(as I don't know how to use code tags here [if i can use code tags
here]).
template <class T>
// MyType is a struct
MyType ConvFunc(T input)
{
// conversion manipulation that has nothing to do with the
conversion
}
I am not sure what code tags are, sorry about making it inconvenient to
you. We post code here. Code is code, the alphabet is limited, the
numbers are common and the special symbols are in most cases don't need
to be tri- or di-graphed. Read the group and get the feel before
posting, it's never too late to learn the rules.
As for the function
template<class T> void foo(T t);
, you don't need to supply the template argument if your function
argument is already of that type, the compiler will take care of the
template argument deduction. If you do want to call a *different*
function with a particular argument, do supply it. If both are the
same, it won't matter. For, example, if I want to call my 'foo'
instantiated with 'unsigned' as its template argument, but supply an
integer, I would do
foo<unsigned>(42);
, for example. Since 42 is already an int, I don't have to write
foo<int>(42);
, IOW, it's the same as writing
foo(42); // compiler deduces T == int
V