System.Collections.BitArray.GetEnumerator C# (CSharp) Method

GetEnumerator() public method

public GetEnumerator ( ) : IEnumerator
return IEnumerator
        public IEnumerator GetEnumerator()
        {
            return new BitArrayEnumeratorSimple(this);
        }

Usage Example

示例#1
0
        /// <summary>
        /// Check if two arrays of bits are equals
        /// Returns true if every bit of this first array is equal to the corresponding bit of the second, false otherwise
        /// </summary>
        public static bool Equals(BitArray a, BitArray b)
        {
            if (a.Length != b.Length) return false;

            var enumA = a.GetEnumerator();
            var enumB = b.GetEnumerator();

            while (enumA.MoveNext() && enumB.MoveNext())
            {
                if ((bool)enumA.Current != (bool)enumB.Current) return false;
            }
            return true;
        }
All Usage Examples Of System.Collections.BitArray::GetEnumerator