RankedMapTKey, TValue Constructor (IComparerTKey) |
Namespace: Kaos.Collections
public RankedMap( IComparer<TKey> comparer )
Exception | Condition |
---|---|
InvalidOperationException | When comparer is null and no other comparer available. |
This class requires an IComparer implementation to perform key comparisons. If comparer is null, the default comparer for the type will be used. If the key type implements the IComparableinterface, the default comparer uses that implementation. If no comparison implementation is available, the Add method will fail on the second element.
// Keys will compare case insensitive with this constructor. var fmt = new RankedMap<string,string> (StringComparer.InvariantCultureIgnoreCase);