UnsafeMutableBufferPointer

    A nonowning collection interface to a buffer of mutable elements stored contiguously in memory.

    @frozen struct UnsafeMutableBufferPointer<Element> where Element : ~Copyable

    You can use an UnsafeMutableBufferPointer instance in low level operations to eliminate uniqueness checks and, in release mode, bounds checks. Bounds checks are always performed in debug mode.

    UnsafeMutableBufferPointer Semantics

    An UnsafeMutableBufferPointer instance is a view into memory and does not own the memory that it references. Copying a value of type UnsafeMutableBufferPointer does not copy the instances stored in the underlying memory. However, initializing another collection with an UnsafeMutableBufferPointer instance copies the instances out of the referenced memory and into the new collection.

    Citizens in Swift

    Conformances

    Typealiases

    Type members

    Instance members

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Citizens in Swift

    where Element:Copyable, Element:Escapable

    Conformances

    Instance features

    Show obsolete interfaces (2)

    Hide obsolete interfaces

    Citizens in Swift

    where Element:Escapable

    Conformances

    Available in Synchronization

    Typealiases

    Type members

    Available in Synchronization

    where Element:Escapable

    Conformances

    Available in FoundationEssentials

    where Element == UInt8

    Conformances

    • protocol ContiguousBytes

      Indicates that the conforming type is a contiguous collection of raw bytes whose underlying storage is directly accessible by withUnsafeBytes.

    Instance members

    Extension in InternalCollectionsUtilities

    Instance members