From cppreference.com
Usage
: as an alternative for ||
Example
Run this code
#include<iostream>voidshow(boolz,constchar*s,intn){constchar*r{z?" true ":" false "};if(n==0)std::cout<<"┌────────────────┬─────────┐\n";if(n<=2)std::cout<<"│ "<<s<<" │ "<<r<<" │\n";if(n==2)std::cout<<"└────────────────┴─────────┘\n";}intmain(){show(falseorfalse,"false or false",0);show(falseortrue,"false or true ",1);show(trueorfalse,"true or false",1);show(trueortrue,"true or true ",2);}Output:
┌────────────────┬─────────┐ │ false or false │ false │ │ false or true │ true │ │ true or false │ true │ │ true or true │ true │ └────────────────┴─────────┘ See also
,
,
,
,