Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | List of all members
Loyc.Collections.IArray< T > Interface Template Reference

This interface models the capabilities of an array: getting and setting elements by index, but not adding or removing elements. More...


Source file:
Inheritance diagram for Loyc.Collections.IArray< T >:
Loyc.Collections.IListSource< T > Loyc.Collections.IArraySink< T > Loyc.Collections.IAutoSizeArray< T > Loyc.Collections.IListEx< T > Loyc.Collections.ListSlice< T > Loyc.Collections.AList< T > Loyc.Collections.DList< T > Loyc.Collections.IListExWithChangeEvents< T > Loyc.Collections.Impl.ListExBase< T > Loyc.Collections.ISparseListEx< T > Loyc.Collections.ReversedList< T > Loyc.Collections.SparseAList< T > Loyc.Collections.IndexedAList< T > Loyc.Collections.Impl.ListWithChangeEvents< T, TList > Loyc.Collections.SparseAList< T >

Remarks

This interface models the capabilities of an array: getting and setting elements by index, but not adding or removing elements.

Member list:

public T this[int index] { get; set; }
public T TryGet(int index, ref bool fail);
public Iterator<T> GetIterator();
public int Count { get; }
public IEnumerator<T> GetEnumerator();
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator();

Properties

new T this[int index] [get, set]
 Gets or sets an element of the array-like collection. More...
 
- Properties inherited from Loyc.Collections.IArraySink< T >
this[int index] [set]
 

Public Member Functions

bool TrySet (int index, T value)
 
- Public Member Functions inherited from Loyc.Collections.IListSource< T >
IRange< T > Slice (int start, int count=int.MaxValue)
 Returns a sub-range of this list. More...
 

Property Documentation

◆ this[int index]

new T Loyc.Collections.IArray< T >.this[int index]
getset

Gets or sets an element of the array-like collection.

Returns
The value of the array at the specified index.

This redundant indexer is required by C# because the compiler imagines that the setter in IArraySink<T> conflicts with the getter in IListSource<T>.