M
Mark Snelling
I wish to typedef a templated function for readability but cannot find
the correct syntax to do so. For example:
#include <iostream>
template< int I >
void foo()
{
std::cout << I << std::endl;
}
typedef foo< 2 > foo2; // <--- I wish to do something like this
int main( int argc, char* argv[] )
{
foo< 1 >();
foo2();
return 0;
}
In the above code I want to create a typedef for the function template
foo() using the value 2 as the template parameter. Is this even
possible?
Cheers,
Mark.
the correct syntax to do so. For example:
#include <iostream>
template< int I >
void foo()
{
std::cout << I << std::endl;
}
typedef foo< 2 > foo2; // <--- I wish to do something like this
int main( int argc, char* argv[] )
{
foo< 1 >();
foo2();
return 0;
}
In the above code I want to create a typedef for the function template
foo() using the value 2 as the template parameter. Is this even
possible?
Cheers,
Mark.