Structure

OpaquePointer

A wrapper around an opaque C pointer.

Declaration

@frozen struct OpaquePointer

Overview

Opaque pointers are used to represent C pointers to types that cannot be represented in Swift, such as incomplete struct types.

Topics

Initializers

init<T>(UnsafePointer<T>)

Converts a typed UnsafePointer to an opaque C pointer.

init<T>(UnsafeMutablePointer<T>)

Converts a typed UnsafeMutablePointer to an opaque C pointer.

init?<T>(UnsafePointer<T>?)

Converts a typed UnsafePointer to an opaque C pointer.

init?<T>(UnsafeMutablePointer<T>?)

Converts a typed UnsafeMutablePointer to an opaque C pointer.

init?(bitPattern: Int)

Creates an OpaquePointer from a given address in memory.

init?(bitPattern: UInt)

Creates an OpaquePointer from a given address in memory.

Instance Properties

var debugDescription: String

A textual representation of the pointer, suitable for debugging.

var hashValue: Int

The hash value.

Instance Methods

func hash(into: inout Hasher)

Hashes the essential components of this value by feeding them into the given hasher.

Operator Functions

static func != (OpaquePointer, OpaquePointer) -> Bool

Returns a Boolean value indicating whether two values are not equal.

static func == (OpaquePointer, OpaquePointer) -> Bool

Returns a Boolean value indicating whether two values are equal.

See Also

C and Objective-C Pointers

struct AutoreleasingUnsafeMutablePointer

A mutable pointer-to-ObjC-pointer argument.