Skip to content

Commit dd2648b

Browse files
committed
[cxx-interop] Conform Swift pointers to UnsafeCxxMutableInputIterator
This is currently a no-op since we don't auto-conform custom types to any kind of `MutableCollection` protocols: `UnsafeCxxMutableInputIterator` is only used for `std::map` conformance to `CxxDictionary` in the overlay. However, this will be useful in the future if we start conforming mutable C++ containers to certain Swift protocols: that way containers that use raw non-const pointers as iterators would be treated as mutable in Swift.
1 parent b92530f commit dd2648b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/Cxx/UnsafeCxxIterators.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public protocol UnsafeCxxMutableInputIterator: UnsafeCxxInputIterator {
6161
override var pointee: Pointee { get set }
6262
}
6363

64+
extension UnsafeMutablePointer: UnsafeCxxMutableInputIterator {}
65+
6466
/// Bridged C++ iterator that allows computing the distance between two of its
6567
/// instances, and advancing an instance by a given number of elements.
6668
///

0 commit comments

Comments
 (0)