UnsafeMutableBufferPointer

A non-owning pointer to buffer of mutable Ts stored contiguously in memory, presenting a Collection interface to the underlying elements.

Inheritance CollectionType, DebugPrintable, MutableCollectionType, SequenceType, _CollectionType, _SequenceType, _Sequence_Type View Protocol Hierarchy →
Associated Types

Type alias inferred.

  • Element = T

Type alias inferred.

Type alias inferred.

Type alias inferred.

Import
  • import Swift

Initializers

init(start:count:)

Construct an UnsafeMutablePointer over the count contiguous T instances beginning at start.

Declaration

Instance Variables

var baseAddress: UnsafeMutablePointer<T>

A pointer to the first element of the buffer

Declaration

var count: Int

The number of elements in the buffer

Declaration

  • var count: Int { get }
var debugDescription: String

A textual representation of self, suitable for debugging.

Declaration

  • var debugDescription: String { get }
var endIndex: Int

The "past the end" position; always identical to count.

endIndex is not a valid argument to subscript, and is always reachable from startIndex by zero or more applications of successor().

Declaration

  • var endIndex: Int { get }
var startIndex: Int

Always zero, which is the index of the first element in a non-empty buffer.

Declaration

  • var startIndex: Int { get }

Subscripts

subscript(_: Int)

Declaration

  • subscript(i: Int) -> T { get nonmutating set }

Instance Methods

func generate()

Return a generator over the elements of this sequence.

Complexity: O(1)

Declaration