(C++) Yoda condition
February 24, 2017 · View on GitHub
(C++) Yoda condition
A Yoda condition [1] is a type of if-statement in which the the constant value (for example '6') is put first, so one can be sure that an unintentional assignment (for example 'if (6 = value)') is detected by the compiler.
Example
References