Hi!
With C++ I've currently gotten to the part where I am learning different STL containers. I've been playing around with lists but I get an error, I just want to know why do I get an error when I do this:
template <typename T>
bool sortDescending(const T& in1, const T& in2)
{
return in1>in2;
}
and then I just try to sort some list with it:
myList.sort(sortDescending);
If I change my sort function it's all fine:
bool sortDescending(const int& in1, const int& in2)
{
return in1>in2;
}
Can anybody explain why exactly C++ forbids me from writing a more generic sort function?