P
Peter Oliphant
I have defined a templated function:
template< typename dataT >
dataT Add_T( dataT x, dataT y ) { return (x+y) ; }
Now, I'd like to do something like:
typedef Add_T<int> Add_int ;
That is, turn the ugly " Add_T<int>( x, y )" into something like "Add_int(x,
y )" (where 'x' and 'y' are 'int's). This is how it's done with templated
class definitions. How is it done with templated functions?
template< typename dataT >
dataT Add_T( dataT x, dataT y ) { return (x+y) ; }
Now, I'd like to do something like:
typedef Add_T<int> Add_int ;
That is, turn the ugly " Add_T<int>( x, y )" into something like "Add_int(x,
y )" (where 'x' and 'y' are 'int's). This is how it's done with templated
class definitions. How is it done with templated functions?