We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4533bf commit e7bce0dCopy full SHA for e7bce0d
Multiset/Multiset.playground/Contents.swift
@@ -25,7 +25,18 @@ set2.add("Foo")
25
set2.isSubSet(of: set) // true
26
set.isSubSet(of: set2) // false
27
28
+// Convenience constructor: pass a Collection of Hashables to the constructor
29
var cacti = Multiset<Character>("cacti")
30
+cacti.allItems
31
var tactical = Multiset<Character>("tactical")
32
cacti.isSubSet(of: tactical) // true
33
tactical.isSubSet(of: cacti) // false
34
+
35
+// Test ExpressibleByArrayLiteral protocol
36
+let set3: Multiset<String> = ["foo", "bar"]
37
+set3.count(for: "foo")
38
39
+// Test Equatable protocol
40
+let set4 = Multiset<String>(set3.allItems)
41
+set4 == set3 // true
42
+set4 == set // false
0 commit comments