Home News DOC Class DL Others Cooker
Documents  >  Tutorial  >  Priority 9
Priority 9 operators

It describes the following operators with priority 9.


|x | yLogical OR operator

It is binary logical OR operator.


Table of contents:


Logical OR operator

Logical OR operator

Logical OR operator is an operator for performing logical OR operation on the left and right operands. The operand must be the bool class.

The class of the result is a bool class.


bool result = true | true; // The result is true;

result = true | false; // The result is true;

result = false | true; // The result is true;

result = false | false; // The result is false;

Operand evaluation is not short-circuit evaluation. The both operands are always evaluated.


If operands return the proxy class, the entity of the proxy is automatically used. The result is the same as calling the Entity getter of the proxy class.


bool b = true;

bool b2 = false;

proxy pro = new proxy(b);

proxy pro2 = new proxy(b2);

bool b3 = pro2 | pro; // b3 is true.

Previous
Copyright © Rice All rights reserved.