C++ Language/Objects/OperatorOverloading

Programming custom implementations for operators is the mechanism for allowing a custom C++ class to be used as a "value type" (which then can behave similar to built-in primitive types like ). For example, client code expects to be able to do ; if you want your custom class to also behave that way, then define its.

Additional information about operator overloading (includes interactive examples)