Ditai C++ Study Notes-Lesson 38-The Pitfalls of Logical Operators

The characteristics of logical operators
(1) The final value of logical expressions can be determined without complete calculation.
(2) Avoid overloading logical operators in actual development.
(3) Replace logical operator overloading with overloaded comparison operators
(4) Use members directly Function instead of logical operator overloading
(5) Use global functions to overload logical operators

Guess you like

Origin blog.csdn.net/cj532419842/article/details/115177623