@@ -40,11 +40,12 @@ internal func forEachElement<C: CxxConvertibleToCollection>(
40
40
extension Array {
41
41
/// Creates an array containing the elements of a C++ container.
42
42
///
43
- /// This initializer copies each element of the C++ container 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
- /// container.
46
+ /// container, assuming that each element is copied in O(1). Note that this
47
+ /// might not 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
@@ -56,11 +57,12 @@ extension Array {
56
57
extension Set {
57
58
/// Creates an set containing the elements of a C++ container.
58
59
///
59
- /// This initializer copies each element of the C++ container 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
- /// container.
63
+ /// container, assuming that each element is copied in O(1). Note that this
64
+ /// might not 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