C++: call original definition of operator equals
- by Luis Daniel
I am overloading the operator equals (==) as show bellow:
#include <string>
#include <algorithm>
bool operator == (std::string str1, std::string str2) {
std::transform(str1.begin(), str1.end(), str1.begin(), ::tolower);
std::transform(str2.begin(), str2.end(), str2.begin(), ::tolower);
return (str1 == str2);
}
but, the problem appear on line return (str1 == str2), because operator == is called recursively. So, how can I call the original definition for operator equals (not the overloaded) ?
Best regards