Contents

append(repeating:count:as:_:)

Appends the given value’s bytes repeatedly to this span’s bytes.

Declaration

mutating func append<T>(repeating repeatedValue: T, count: Int, as type: T.Type, _ byteOrder: ByteOrder) where T : BitwiseCopyable, T : ConvertibleToBytes, T : FixedWidthInteger

Parameters

  • repeatedValue:

    The value to store as raw bytes.

  • count:

    The number of copies of repeatedValue to append to this span.

  • type:

    The type of the instance to store repeatedly.

  • byteOrder:

    The order in which the bytes will be encoded to the span.

Discussion

There must be at least count * MemoryLayout<T>.stride bytes available in the span.