While working with the This will manipulate objects in the archive equally, only when a new hashet is created will do it. What is the advice when I want to work with those sets where I should know that the entries are unique? Do your roll, where does the add (t item) add a copy from the item, and the calculator calculates the copies of the contained objects? The challenge is that each inherent element should be deep-copied, at least in its objects which affect its equality. Another solution must roll yourself, and accept only those elements that apply INotifyPropertyChanged, and to investigate the incident again on the incident to resemble it, but it is seriously Not limited to mentioning lots of work and performance loss under the hood. Still, I thought that another possible solution is ensuring that all the fields are constructs in the reader or constructure, all solutions have major drawbacks. Do I have any other options? You are actually talking about object identification if you are going to haveh items, then No need of identification, so that they can be compared. This is a problem with your hashset in C #, I had a nervous problem recently :
HashSets does not guarantee the unity of elements; They are not set, they guarantee that the item is not added when the
Add (T item) is if the item is in the
Zero main () {hashaseet & lt; Examiner & gt; Testet = New Hashet & lt; Examiner & gt; (); Testet.Add (new tester (1)); Testet.Add (new tester (2)); Forehach (in tester tester) {tester.Dump (); } Foreach (tester tester in testet) {tester.myint = 3; } Foreach (tester in testet) {tester.Dump (); } Hashaseet & lt; Examiner & gt; Secondhashset = new hashset & lt; Examiner & gt; (testing); Taurus Tester in Taurus (Terror.)}} Class tester {public insent; Public examiner (int i) {this.myint = i; } Public override baul par (object o) {if (o == empty) false return; Examiner = Key tester; If returned (which == empty) wrong; Return (this.myint == that.myint); } Public override int GetHashCode () {this.myint return; } Public override string toasting () {return this.myint.ToString ()}}}
public insent it should actually be
to read , and should only be set in the constructor.
tester objects, set Not to recognize you Need to think about Ike is not an easy problem.
Comments
Post a Comment