tl;dr: Is there a non-short circuit logical AND in C++ (similar to &&)?
I\'ve got 2 functions that I want to call, and use the return values to figure out th
Yes there are built in operators for doing this. + does a non short circuiting OR and * does an AND.
+
*
#include <iostream> using namespace std; void print(bool b) { cout << boolalpha << b << endl; } int main() { print(true + false); print(true * false); }
Output:
true false
true
false