Closed oscbyspro closed 1 year ago
Hm. I believe I want this—not necessarily because isFull
is the most useful thing ever made, but because I need an efficient, non-allocating, way of matching a repeating bit. I've played with the following, and I find it easy to reason about. I mean, I already have init(repeating:)
because it comes up a lot:
@_transparent public func matches(repeating bit: Bool) -> Bool {
bit ? isFull : isZero
}
I admit that isFull
sounds like is collection property, relating in some way to isEmpty
. Having said that, it makes sense considering an isFull
integer cannot be modified by the OR operator.
As mentioned in (#103), I've found some value in the bitwise inverse
isZero
.