From: Jean Privat Date: Tue, 31 Mar 2015 03:22:05 +0000 (+0700) Subject: Merge: lib/std/union_find: make DisjointSet Cloneable X-Git-Tag: v0.7.3~1 X-Git-Url: http://nitlanguage.org Merge: lib/std/union_find: make DisjointSet Cloneable Just because I need it. I'm still not sure about what is the best way to deal with the various copy-constructors and clone methods. I think the following make sense: A copy constructor named `from` that takes, if possible a general classifier (like an interface). This named constructor may use `nosuper` to avoid the automatic invocation of the standard init method if this cause a useless complex initialization that will be throw away by the copy. A direct copy `clone` than can just return `new SELFTYPE.from(self)` The advantage is that for simple clone, the `clone` method do the job. If one want to change the class but keep the data, then the `from` constructor can be used. Like `new HashSet.from([1,2,3])` Pull-Request: #1226 Reviewed-by: Alexis Laferrière Reviewed-by: Romain Chanoir Reviewed-by: Alexandre Terrasa --- 2d0367d1c72c7de07b21daff6685044317d47f2b