B
Brett Romero
What are the reasons to use one over the other?
SortedList implements IComparer.Compare(). Why would you also want to
create a SortedList class that implements IComparable.CompareTo()?
I know IComparable compares objects of the same type and IComparer
doesn't. Is that the main reason for using one over the other? So if
a SortedList contains objects all of Type A, I should implement
IComparable and not depend on the SortedList implementation of
IComparer? How does using the default implementation affect real world
results in anyway?
Thanks,
Brett
SortedList implements IComparer.Compare(). Why would you also want to
create a SortedList class that implements IComparable.CompareTo()?
I know IComparable compares objects of the same type and IComparer
doesn't. Is that the main reason for using one over the other? So if
a SortedList contains objects all of Type A, I should implement
IComparable and not depend on the SortedList implementation of
IComparer? How does using the default implementation affect real world
results in anyway?
Thanks,
Brett