I am implementing a list, and I am wondering about the definition of the IndexOutOfRange. Which one of the following do you think is better?
/// <exception cref="IndexOutOfRangeException">if index is less than 0
/// or greater than <see cref="Count"/>
public T this[int index] { get { return myArray[index]; } }
Or
/// <exception cref="IndexOutOfRangeException">if index outside the valid range
/// for an array of length equal to <see cref="Count"/></exception>
public T this[int index] { get { return myArray[index]; } }
I am thinking about the case when this class would be used from a .NET language that indexes arrays starting from 1. I don't know much about the topic, but is the second version better than the first by any means?