[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppOperatorOverloading
Preserve natural semantics for overloaded operators [1]. Consider overloading to avoid implicit type conversions [2].
Examples of operator overloading:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppOperatorOverloading
(C++) operator overloading
The technique of defining (or overloading) an operator. This can be beneficial for self-made classes.Preserve natural semantics for overloaded operators [1]. Consider overloading to avoid implicit type conversions [2].
Examples of operator overloading:
- stream out operator ( << )
- multiplication ( * )
- divide equals ( /= )
References
- 1) Herb Sutter and Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6, Item 26: Preserve natural semantics for overloaded operators
- 2) Herb Sutter and Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6, Item 29: Consider overloading to avoid implicit type conversions.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
