I am using a HashSet
where I use instances of classes as keys, that is, the references to them.
What I am unsure of, is if the HashSet
will compare the references, which would mean every instance would be different, or the actual values contained in the object, which is what I need.
Does a HashSet
compare by value or reference, and if it is the latter, what would be a good way to let it compare by value?