custom comparison for class object and value
Hi We have three different possible comparison as below: class object and class object class object and value value and class object Please refer below code: https://code.sololearn.com/cA12A247a25a Now comparison 1 is working as both are class object and calls overloaded == operator Now comparison 2 is working as RHS is converted to class object using constructor not marked as explicit Is it true? If so, RHS is again a class object constructed by non marked explicit constructor Now, question is that why 3 comparison does not work without friend function? As discussed in option 2 above, RHS is converted to class object , then why value in LHS is not converted to class object and then call overloaded class operator instead of choosing friend function? Feel free to ask for queries in case question is not clear.