Open ottne opened 9 years ago
Operator overloading serves to make code more readable and should be used whenever a library allows it. For example:
// use overloaded assignment operator that takes a char* argument std::string foo = "foo"; // use compare function if(foo.compare("bar") == 0) {...} // use operator overloading, better readabilty if(foo == "bar") {...}
We should replace all occurences of compare with overloaded comparison operators.
Operator overloading serves to make code more readable and should be used whenever a library allows it. For example:
We should replace all occurences of compare with overloaded comparison operators.