Generic bitmask utility type written in Swift.