I was reading about friend keyword in c++ and couldn't understand why we need such a thing. For example, I was told that since the following function:
bool operator==(const Rational& r1, const Rational&r2);
needs to access private members like r1.numerator we should give it access by declaring it as Friend, But on the other side I have a function called GetNumerator() so why can't I just change r1.numerator with r1.GetNumerator()?