UnsafeBufferPointer

struct UnsafeBufferPointer<T>

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

Inheritance CollectionType, DebugPrintable, SequenceType, _CollectionType, _SequenceType, _Sequence_Type View Protocol Hierarchy →
Associated Types
Generator = UnsafeBufferPointerGenerator<T>

Type alias inferred.

Element = T

Type alias inferred.

Index = Int

Type alias inferred.

SubSequence = Slice<UnsafeBufferPointer<T>>

Type alias inferred.

Import import Swift

Initializers

init(start:count:)

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

Declaration

init(start: UnsafePointer<T>, count: Int)

Instance Variables

var baseAddress: UnsafePointer<T>

A pointer to the first element of the buffer

Declaration

var baseAddress: UnsafePointer<T> { get }
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 }

Instance Methods

func generate()

Return a generator over the elements of this sequence.

Complexity: O(1)

Declaration

func generate() -> UnsafeBufferPointerGenerator<T>