Xcode 6.3 (6D570): [Swift] Add UnsafeMutablePointer functions overloads that work with UnsafePointer
| Originator: | janoschhildebrand | ||
| Number: | rdar://20651147 | Date Originated: | 22-Apr-2015 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.3 (6D570) |
| Classification: | Enhancement | Reproducible: | NA |
Summary: An UnsafeMutablePointer includes functions to initialize or assign to the memory it points to. Several of these functions copy from the source without "destroying" it thus not conceptually modifying the source data. The relevant functions are: func assignFrom(source: UnsafeMutablePointer<T>, count: Int) func assignBackwardFrom(source: UnsafeMutablePointer<T>, count: Int) func initializeFrom(source: UnsafeMutablePointer<T>, count: Int) It would be great if UnsafeMutablePointer included overloads of these functions that accepted UnsafePointer<T> as the source argument. Using such overloaded variants would be nicer than having to "unsafely" cast an UnsafePointer to an UnsafeMutablePointer for use a source. Steps to Reproduce: Expected Results: Actual Results: Version: Xcode 6.3 (6D570) Apple Swift version 1.2 (swiftlang-602.0.49.3 clang-clang-602.0.49)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!