func formSymmetricDifference (Self)
RawValue
conforms to FixedWidthInteger
.
RawValue
がFixedWidthInteger
に準拠する時に利用可能です。
Availability
Technology
mutating func formSymmetricDifference(_ other: Self)
other
A set of the same type. 同じ型の集合。
In the following example, the elements of the employees
set that are also members of neighbors
are removed from employees
, while the elements of neighbors
that are not members of employees
are added to employees
. In particular, the names "Bethany"
and "Eric"
are removed from employees
while the name "Forlani"
is added.
以下の例において、employees
集合の要素でまたneighbors
のメンバであるものはemployees
から削除されます、一方でneighbors
の要素でemployees
の要素でないものはemployees
に加えられます。個別的には、名前"Bethany"
と"Eric"
はemployees
から削除される一方、名前"Forlani"
は加えられます。
var employees: Set = ["Alicia", "Bethany", "Diana", "Eric"]
let neighbors: Set = ["Bethany", "Eric", "Forlani"]
employees.formSymmetricDifference(neighbors)
print(employees)
// Prints "["Diana", "Forlani", "Alicia"]"
func formSymmetricDifference (Self)
RawValue
conforms to FixedWidthInteger
.
RawValue
がFixedWidthInteger
に準拠する時に利用可能です。
func union(Self) -> Self
func formUnion (Self)
func intersection(Self) -> Self
func formIntersection (Self)
func symmetricDifference (Self) -> Self