c# - Can I compare two arbitrary references in a way that can be used in a CompareTo method? -


i'm writing implementation of icomparable<t>.compareto(t) struct. i'm doing member-wise comparison (i.e. d = a.compareto(other.a); if (d != 0) { return d; } etc.), 1 of members of class (let's call y) doesn't implement icomparable or have other reasonable way of comparing want compare references (in case know instances of y unique). there way of doing that yield int suitable use in comparison method?

it's not meaningful compare references looking order relationships. it's meaningful equality.


Comments

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -