To simplify my question, I'm using IList
and IList<T>
as the example.
Since IList
declared a method Add(object value)
and IList<T>
declared a method Add(T value)
. My new class has to have two methods for implementation.
class myList<T> : IList<T>, IList
{
public void IList.Add(object value)
{
this.Add(value as T);
}
public void Add(T value)
{...}
}
Is it possible to avoid such "meaningless" replication?