T IReadOnlyList <T> .this[int index] { get { ThrowInvalidOperationIfDefault(); if (index < 0 || index >= _count) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } return(_array[_offset + index]); } }
public Char8 this[int index] { get { // Just like String, we don't allow indexing into the null terminator itself. if ((uint)index >= (uint)Length) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } return(Unsafe.Add(ref DangerousGetMutableReference(), index)); } }
T IReadOnlyList <T> .this[int index] { get { if (_array == null) { ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_NullArray); } if (index < 0 || index >= _count) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } Contract.EndContractBlock(); return(_array[_offset + index]); } }
public T this[int index] { get { if ((uint)index >= (uint)_count) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } return(_array[_offset + index]); } set { if ((uint)index >= (uint)_count) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } _array[_offset + index] = value; } }