a if condition is 0, b otherwise.T ctSelect(T)(uint condition, T a, T b) if (is(T == ubyte) || is(T == ushort) || is(T == uint) || is(T == ulong)) pure nothrow @nogc @safeSelects between two values in constant time.
Returns a if condition is 0, or b if condition is non-zero. The selection is performed using bitwise operations without branching.
condition | Selection flag (0 selects a, non-zero selects b). |
a | Value returned when condition is 0. |
b | Value returned when condition is non-zero. |
a if condition is 0, b otherwise.