Possible Duplicate:
Operator overloading
I need to implement template class in following way
Requirement:
you must provide code for implementing a sorting 'comparator' called SensibleLessThan
, that is capable of sorting text strings.
and it will call in following way.
SensibleLessThan<String> comparer;
String lhs = "Aadvark";
String rhs = "Zygote";
comparer(lhs, rhs);
Should I write SensibleLessThan
class and create object? But they are calling comparer like
function. Can anyone provide me some idea how can I accomplish this?
Please let me know if I need to provide more info.