开发者

Is there already a comparison-interface in the framework

开发者 https://www.devze.com 2023-01-12 12:54 出处:网络
which is equivalent to interface ISomeKindOfCompare<T> { bool Matches(T item); } I know IComparer and IEqualityComparer and so on, but that\'s 开发者_StackOverflownot what I am looking for.IE

which is equivalent to

interface ISomeKindOfCompare<T>
{
    bool Matches(T item);
}

I know IComparer and IEqualityComparer and so on, but that's 开发者_StackOverflownot what I am looking for.


IEquatable<T> looks the same as your ISomeKindOfCompare<T>. That is, it lets you ask "is this object equal to some T?".


IComparable? IEquatable<T>?

0

精彩评论

暂无评论...
验证码 换一张
取 消