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
You can trivially write your own.
bool LongCircuitAnd( bool term1, bool term2 ) { return term1 && term2; }
bool Func3(int x, int y, int z, int q){
return LongCircuitAnd( Func1(x,y), Func2(z,q) );
And if you want to be very fancy, you could even inline it!!!
Okay, Okay, if you really really don't want the terrible overhead of calling a function.
bool Func3(int x, int y, int z, int q){
return ((int)Func1(x,y)) * ((int)Func2(z,q));
But I don't consider that elegant. It its conceivable that an overly smart compiler could short circuit this...