A set of the same type as the current set.
現在の集合と同じ型の集合。
Discussion
解説
In the following example, the elements of the visitors set are added to the attendees set:
次の例において、visitors集合の要素はattendees集合に加えられます。
var attendees: Set= ["Alicia", "Bethany", "Diana"]let visitors: Set= ["Diana", "Marcia", "Nathaniel"]attendees.formUnion(visitors)print(attendees)// Prints "["Diana", "Nathaniel", "Bethany", "Alicia", "Marcia"]"
If the set already contains one or more elements that are also in other, the existing members are kept.otherの中にもある1つ以上の要素をこの集合がすでに含むならば、既存のメンバはそのままにしておかれます。
var initialIndices =Set(0..<5)initialIndices.formUnion([2, 3, 6, 7])print(initialIndices)// Prints "[2, 4, 6, 7, 0, 1, 3]"
Returns a new set with the elements that are either in this set or in the given set, but not in both.
この集合の中か与えられた集合の中かどちらかの、しかし両方の中にではない要素を持つ新しい集合を返します。
Removes the elements of the set that are also in the given set and adds the members of the given set that are not already in the set.
与えられた集合の中にもあるこの集合の要素を削除します、そして与えられた集合のメンバでこの集合の中にはまだないものを加えます。