core.bitop.bsf without the undefined behaviour. safeOp.bsf(0) will raise IntFlag.undef.
1 import checkedint.sticky : safeOp; // use IntFlagPolicy.sticky 2 3 assert(safeOp.bsf(20) == 2); 4 5 safeOp.bsf(0); 6 assert(IntFlags.local.clear() == IntFlag.undef);
See Implementation
core.bitop.bsf without the undefined behaviour. safeOp.bsf(0) will raise IntFlag.undef.