/// <summary> /// Indicates whether this and another instance are considered equivalent. /// </summary><returns> /// True if both instances share the same backing array, or if both backing arrays are absent; otherwise false. /// </returns> /// <param name="other">Another instance to compare against.</param> public bool Equals(ReadOnlyArray <T> other) { return(object.ReferenceEquals(this.array, other.array)); }
/// <summary> /// Creates an <see cref="Enumerator"/> for the array wrapped in the <see cref="ReadOnlyArray{T}"/> argument. /// </summary> public Enumerator(ReadOnlyArray <T> array) : this(array.Array) { }
/// <inheritdoc cref="ArrayEnumeratorReadOnly{T}.ArrayEnumeratorReadOnly(int, ReadOnlyArray{T}, int)"/> public static ArrayEnumeratorReadOnly <T> CreateReadOnly <T>(int start, ReadOnlyArray <T> array, int length) { return(new ArrayEnumeratorReadOnly <T>(start, array, length)); }
/// <summary> /// Creates a <see cref="ArrayEnumeratorReadOnly{T}"/> from a <see cref="ReadOnlyArray{T}"/>. /// </summary> /// <param name="array">Array to create enumerator for.</param> public ArrayEnumeratorReadOnly(ReadOnlyArray <T> array) : this(array.Source, 0, array.Length - 1) { }
// ---- /// <inheritdoc cref="ArrayEnumeratorReadOnly{T}.ArrayEnumeratorReadOnly(ReadOnlyArray{T})"/> public static ArrayEnumeratorReadOnly <T> CreateReadOnly <T>(ReadOnlyArray <T> array) { return(new ArrayEnumeratorReadOnly <T>(array)); }