@@ -38,13 +38,14 @@ internal func forEachElement<C: CxxConvertibleToCollection>(
38
38
}
39
39
40
40
extension Array {
41
- /// Creates an array containing the elements of a C++ collection .
41
+ /// Creates an array containing the elements of a C++ container .
42
42
///
43
- /// This initializer copies each element of the C++ collection to a new Swift
44
- /// array.
43
+ /// This initializes the array by copying every element of the C++ container.
45
44
///
46
45
/// - Complexity: O(*n*), where *n* is the number of elements in the C++
47
- /// collection.
46
+ /// container when each element is copied in O(1). Note that this might not
47
+ /// be true for certain C++ types, e.g. those with a custom copy
48
+ /// constructor that performs additional logic.
48
49
public init < C: CxxConvertibleToCollection > ( _ c: C )
49
50
where C. RawIterator. Pointee == Element {
50
51
@@ -54,13 +55,14 @@ extension Array {
54
55
}
55
56
56
57
extension Set {
57
- /// Creates an set containing the elements of a C++ collection .
58
+ /// Creates an set containing the elements of a C++ container .
58
59
///
59
- /// This initializer copies each element of the C++ collection to a new Swift
60
- /// set.
60
+ /// This initializes the set by copying every element of the C++ container.
61
61
///
62
62
/// - Complexity: O(*n*), where *n* is the number of elements in the C++
63
- /// collection.
63
+ /// container when each element is copied in O(1). Note that this might not
64
+ /// be true for certain C++ types, e.g. those with a custom copy
65
+ /// constructor that performs additional logic.
64
66
public init < C: CxxConvertibleToCollection > ( _ c: C )
65
67
where C. RawIterator. Pointee == Element {
66
68
0 commit comments