What I\'d like to do is something like this:
template
DataType myFunc(DataType in)
{
...
}
typedef myFunc myFunc_i;
myFunc
Code Example:
#include
template
T sqr(T a){
return a*a;
}
auto s = sqr;
int main() {
std::cout<
prints 9, that means that used int function
auto
requires c++0x, you may use real typename instead, but it's ugly and you'll need check changing signature too.
Besides, this code, may disallow your compiler to inline this function
As for me, it's often better use full name with <>
In your case you need not use <>
because myFunc
is enough(DataType
may be got from argument type)