This function does the same thing as comparison operators, however the operator is a runtime-known enum value. Works on any operands that support comparison operators.
pub fn compare(a: anytype, op: CompareOperator, b: anytype) bool
pub fn compare(a: anytype, op: CompareOperator, b: anytype) bool {
return switch (op) {
.lt => a < b,
.lte => a <= b,
.eq => a == b,
.neq => a != b,
.gt => a > b,
.gte => a >= b,
};
}