What I'd like to do is something like this:
template <class DataType>
DataType myFunc(DataType in)
{
...
}
typedef myFunc<int> myFunc_i;
myFunc_i(37);
...however, typedefs cannot be used for functions like this in C++. What I was wondering is... what are people's preferred alternatives in this case? The only ones I can think of are:
1) Just deal with it, and always use myFunc syntax 2) Manually create a wrapper function, ie
inline int myFunc_i(int in)
{
return myFunc<int>(in);
}
This would work, but would have the downside of requiring extra maintenance, and the possibility that it would get out of sync (ie, if you change the function signature for myFunc).
Thoughts?