/// <summary> /// Fetches the element at the specified index. /// </summary> /// <exception cref="System.ArgumentOutOfRangeException"> /// Thrown when the specified index is not in range (<0 or >&eq;length). /// </exception> public T this[int index] { get { Contract.RequiresInRange(index, Length); return(PtrUtils.Get <T>( m_object, m_offset + (index * PtrUtils.SizeOf <T>()))); } set { Contract.RequiresInRange(index, Length); PtrUtils.Set <T>( m_object, m_offset + (index * PtrUtils.SizeOf <T>()), value); } }
/// <summary> /// Fetches the element at the specified index. /// </summary> /// <exception cref="System.ArgumentOutOfRangeException"> /// Thrown when the specified index is not in range (<0 or >&eq;length). /// </exception> public T this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Contract.RequiresInRange(index, (uint)Length); return(PtrUtils.Get <T>(Object, Offset, (UIntPtr)index)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private set { Contract.RequiresInRange(index, (uint)Length); PtrUtils.Set(Object, Offset, (UIntPtr)index, value); } }
/// <summary> /// Fetches the element at the specified index. /// </summary> /// <exception cref="System.ArgumentOutOfRangeException"> /// Thrown when the specified index is not in range (<0 or >&eq;length). /// </exception> public T this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Contract.RequiresInRange(index, Length); return(PtrUtils.Get <T>( _object, _offset + (index * PtrUtils.SizeOf <T>()))); } [MethodImpl(MethodImplOptions.AggressiveInlining)] set { Contract.RequiresInRange(index, Length); PtrUtils.Set <T>( _object, _offset + (index * PtrUtils.SizeOf <T>()), value); } }