Initializes the memory referenced by this pointer with the values starting at the given pointer, binds the memory to the values’ type, deinitializes the source memory, and returns a typed pointer to the newly initialized memory.
- Xcode 8.0+
- Swift Standard Library
The type to bind this memory to.
A pointer to the values to copy. The memory in the region
source..<(source + count)must be initialized to type
The number of copies of
valueto copy into memory.
countmust not be negative.
A typed pointer to the memory referenced by this raw pointer.
The memory referenced by this pointer must be uninitialized or initialized to a trivial type, and must be properly aligned for accessing
The memory in the region
source..<(source + count) may overlap with the destination region. The
move method automatically performs a forward or backward copy of all instances from the source region to their destination.
After calling this method on a raw pointer
p, the region starting at
p and continuing up to
p + count * Memory is bound to type
T and initialized. If
T is a nontrivial type, you must eventually deinitialize or move from the values in this region to avoid leaks. Any memory in the region
source..<(source + count) that does not overlap with the destination region is returned to an uninitialized state.