Source/Fusion/Core/ObservableList/SumTree.Operations.cs
/// <summary>
/// Return a new tree with value inserted at index. O(log n).
/// </summary>
Return a new tree with value inserted at index.
Return a new tree with value inserted at index .
public SumTree<T> Insert(int index, T value)
		{
			if (index < 0 || index > Count)
				throw new IndexOutOfRangeException("index");
			return _tree.MatchWith(
				tree => NonEmpty(InsertInner(0, tree, Count, index, value), Count + 1),
				() => NonEmpty(Tree.Leaf(value), 1));
		}
public SumTree < T > Insert ( int index , T value ) { if ( index < 0 || index > Count ) throw new IndexOutOfRangeException ( " " ) ; return _tree . MatchWith ( tree => NonEmpty ( InsertInner ( 0 , tree , Count , index , value ) , Count + 1 ) , ( ) => NonEmpty ( Tree . Leaf ( value ) , 1 ) ) ; }
Return a new tree with value inserted at index.
Return a new tree with value inserted at index .
index
int
value
T