예제 #1
0
 public LstInternal <A> SetItem(int index, A value)
 {
     if (isnull(value))
     {
         throw new ArgumentNullException(nameof(value));
     }
     if (index < 0 || index >= Root.Count)
     {
         throw new IndexOutOfRangeException();
     }
     return(new LstInternal <A>(ListModule.SetItem(Root, value, index), Rev));
 }
예제 #2
0
 /// <summary>
 /// Set an item at the specified index
 /// </summary>
 public Lst <T> SetItem(int index, T value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("'value' cannot be null.");
     }
     if (index < 0 || index >= Root.Count)
     {
         throw new IndexOutOfRangeException();
     }
     return(new Lst <T>(ListModule.SetItem(Root, value, index), Rev));
 }