What are the basic rules and idioms for operator overloading?

Note: The answers were given in a specific order, but since many users sort answers according to votes, rather than the time they were given, here’s an index of the answers in the order in which they make the most sense: The General Syntax of operator overloading in C++ The Three Basic Rules of Operator … Read more