[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppLogicalOrOperator
Avoid overloading ||.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppLogicalOrOperator
(C++) || operator
The logical-or-operator is used in conditional statements.
if (x==0 || y==0)
{
//Either x or y (or both) were equal to zero
//Do something
}
Avoid overloading ||.
'Logical OR operator' links
Reference
- Herb Sutter and Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6, Item 30: Avoid overloading &&, || or , (comma).
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
