Logical operators
Template:cpp/language/sidebar Returns a boolean value.
Operator name | Keyword | Syntax | Overloadable | Prototype examples (for Template:cpp) | |
---|---|---|---|---|---|
Inside class definition | Outside class definition | ||||
negation | Template:cpp | !a
|
Yes | Template:cpp | Template:cpp |
AND | Template:cpp | a && b
|
Yes | Template:cpp | Template:cpp |
inclusive OR | Template:cpp | a || b
|
Yes | Template:cpp | Template:cpp |
|
See also
Common operators | ||||||
---|---|---|---|---|---|---|
assignment | increment decrement |
arithmetic | logical | comparison | member access |
other |
a = b |
++a |
+a |
!a |
a == b |
a[...] |
function call |
a(...) | ||||||
comma | ||||||
a, b | ||||||
conditional | ||||||
a ? b : c | ||||||
Special operators | ||||||
static_cast converts one type to another related type |