/// <summary> /// Performs a bitwise XOR between the bits of this /// <see cref="BitArrayNeo"/> and <paramref name="x"/>, /// modifying the former. /// </summary> /// <param name="x">The other bit array.</param> /// <returns>Whether the content of this bit array actually changed.</returns> /// <exception cref="ArgumentException">The bit arrays have different <see cref="BitCapacity"/>ies.</exception> public bool Xor(BitArrayNeo x) { if (_bitCapacity != x._bitCapacity) { ThrowDifferentCapacity(nameof(x)); } return(BitAlgorithms.Xor(_data.AsSpan(), x._data.AsSpan())); }
/// <summary> /// Creates a <see cref="BitArrayNeo"/> with the same /// capacity and content of another <see cref="BitArrayNeo"/>. /// </summary> /// <param name="x">The bit array to clone.</param> public BitArrayNeo(BitArrayNeo x) { _bitCapacity = x._bitCapacity; _data = x._data.AsSpan().ToArray(); }