Open
Description
I have a couple [u8; 8]
s that I'd like to xor with each other. Unfortunately this doesn't work:
let x = [0u8; 8];
let y = [1u8; 8];
let z = x ^ y;
I think it should, since this has pretty clear semantics. More generally I think it would make sense to have an impl:
impl<const N: usize, A, B> BitXor<[B; N]> for [A; N]
where
A: BitXor<B>,
{
type Output = [<A as BitXor<B>>::Output; N];
fn bitxor(self, rhs: [B; N]) -> Self::Output {
...
}
}
And similar for BitAnd
and BitOr
.