Instance Propertyswift 6.0.1Swift
indices
var indices: UnsafeBufferPointer<Element>.Indices { get }
Other members in extension
Types
struct Iterator
An iterator for the elements in the buffer referenced by an
UnsafeBufferPointer
orUnsafeMutableBufferPointer
instance.
Typealiases
Type members
init(UnsafeMutableBufferPointer<Element>
) Creates an immutable typed buffer pointer referencing the same memory as the given mutable buffer pointer.
init(rebasing: Slice<UnsafeBufferPointer<Element>>
) Creates a buffer over the same memory as the given buffer slice.
init(rebasing: Slice<UnsafeMutableBufferPointer<Element>>
) Creates a buffer over the same memory as the given buffer slice.
init(start: UnsafePointer<Element>?, count: Int
) Creates a new buffer pointer over the specified number of contiguous instances beginning at the given pointer.
Instance members
var baseAddress: UnsafePointer<Element>?
A pointer to the first element of the buffer.
let count: Int
The number of elements in the buffer.
var debugDescription: String
A textual representation of the buffer, suitable for debugging.
var endIndex: Int
The “past the end” position—that is, the position one greater than the last valid subscript argument.
var isEmpty: Bool
A Boolean value indicating whether the buffer is empty.
var startIndex: Int
The index of the first element in a nonempty buffer.
subscript(Int
) -> Element Accesses the element at the specified position.
subscript(Range<Int>
) -> Slice<UnsafeBufferPointer<Element>> Accesses a contiguous subrange of the buffer’s elements.
subscript(Int
) -> Element Accesses the element at the specified position.
func deallocate(
) Deallocates the memory block previously allocated at this buffer pointer’s base address.
func distance(from: Int, to: Int
) -> Int func extracting(Range<Int>
) -> UnsafeBufferPointer<Element> Constructs a standalone buffer pointer over the items within the supplied range of positions in the memory region addressed by this buffer pointer.
func extracting(some RangeExpression<Int>
) -> UnsafeBufferPointer<Element> Constructs a standalone buffer pointer over the items within the supplied range of positions in the memory region addressed by this buffer pointer.
func extracting((UnboundedRange_) -> ()
) -> UnsafeBufferPointer<Element> Extracts and returns a copy of the entire buffer.
func formIndex(after: inout Int
) func formIndex(before: inout Int
) func index(Int, offsetBy: Int
) -> Int func index(Int, offsetBy: Int, limitedBy: Int
) -> Int? func index(after: Int
) -> Int func index(before: Int
) -> Int func makeIterator(
) -> UnsafeBufferPointer<Element>.Iterator Returns an iterator over the elements of this buffer.
func withContiguousStorageIfAvailable<R>((UnsafeBufferPointer<Element>) throws -> R
) rethrows -> R? func withMemoryRebound<T, E, Result>(to: T.Type, (UnsafeBufferPointer<T>)
throws Executes the given closure while temporarily binding the memory referenced by this buffer to the given type.