I would like to have pointer to template function which has 2 parameters of type T
.
template <typename T>
typedef bool( * f )( T, T );
template <typename T>
bool mniejsze (T pierwszy , T drugi){
if( pierwszy < drugi)
return true;
return false;
}
template <typename T>
bool wieksze (T pierwszy, T drugi){
if( pierwszy > drugi )
return true;
return false;
}
But I get:
error: template declaration of 'typedef'|
EDIT: Then I would like to pass that pointer: Is it the right way?
template <typename T>
T minmax(T a[], int n,bool &f){
return f(a[0],a[1]);
}