I was just checking on this code and testing the working of relational operators in depth, i thought at first the b variable would be -1 in the output but later found out it was 0 , i figured it was implemented in such a way that as soon as one true condition is found the other parts(operands) of OR(||) operator are skipped , Just wondering if anyone has the source code or any clue how the || operator was coded to do this skipping, I know of operator overloading i want to add this small plus point to my overloaded operators as well.
#include<iostream>
int main()
{
int a = 1;
int b = 1;
int c = a || --b;
int d = a-- && --b;
std::cout << "a = " << a << " b = " << b << " c = " << c << " d = " << d << std::endl;
return EXIT_SUCCESS;
}