简体   繁体   中英

C# How to I create a set of sets

I want to create a set of sets (of int)

something like:

SortedSet<SortedSet<int>>

or

HashSet<HashSet<int>>

but when trying to match the sets it uses ReferenceEquals to compare

and thus is useless for my purpose

is there a way to make a set of sets useful in C#?

您需要将HashSet<int>.CreateSetComparer()传递给外部集以通过引用进行比较。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM