Hi,
I want to make a generic function that works like this: I received two
object(whatever it is) and a function to compare both(again whatever it is)
that return a boolean.
I made it like this
void maximum(T first, T second, bool compare())
{
//do something here
cout << "templating";
}
I made a simple comparator function like this one:
bool compareInt(int first, int second)
{
if(first<second) return true;
return false;
}
but I just dont know how to call it. I called it this way
maximum(1, 2, compareInt());
it return an error(cant be compiled).
Any1 got any idea how to do it?
Thanks in advance
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com