Is there any collection in framework like that?
public class DesiredCollection<T>
{
public DesiredCollection(IEqualityComparer<T> comparer)
{
}
}
Requirements:
Various collections take IEqualityComparer<T>
in their constructors (usually as one overload out of several). In particular, Dictionary<TKey, TValue>
and HashSet<T>
fall into this category. They use the equality comparer to check for the existence of keys / elements.
However, you haven't really expressed anything other than the need for a constructor taking an equality comparer. Presumably you'll need more than that... what are you trying to do?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.