Structure

OpaquePointer

A wrapper around an opaque C pointer.

Declaration

Current

@frozen struct OpaquePointer

Previous

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.

Beta

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software