Is it possible to use overloaded operator in another class function instead of the main function?
EXAMPLE I have 2 class functions under public:
bool Angle::operator< (Angle& a2){...} Angle Angle::operator- (Angle a2){...} I want to use the overloaded operator from the first function in the second one. I want the code in the 2nd function to be something like this:
Angle Angle::operator- (Angle a2) { if (*this>=a2) {...} else cout<<"You can't subtract greater angle from a smaller one"<<endl; } So, can I do that? And if I can how?
operator >=? Or by switching your code around to use<instead of>=?