struct
CFunctionPointer
<
T
>
Inheritance |
CVarArgType, DebugPrintable, Equatable, Hashable, NilLiteralConvertible
View Protocol Hierarchy →
|
---|---|
Import |
|
Initializers
Create a nil
instance.
Declaration
init
()
Reinterpret the bits of value
as CFunctionPointer<T>
.
Warning: This is a fundamentally unsafe operation, equivalent to
unsafeBitCast(value, CFunctionPointer<T>.self)
Declaration
init
(
_
value
:
COpaquePointer
)
Create an instance initialized with nil
.
Declaration
init
(
nilLiteral
: ())
Instance Variables
A textual representation of self
, suitable for debugging.
Declaration
var
debugDescription
:
String
{
get
}
The hash value.
Axiom: x == y
implies x.hashValue == y.hashValue
Note: the hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.
Declaration
var
hashValue
:
Int
{
get
}
Instance Methods
Transform self
into a series of machine words that can be
appropriately interpreted by C varargs
Declaration
func
encode
() -
>
[
Word
]
The family of C function pointer types.
In imported APIs,
T
is a Swift function type such as(Int)->String
.Though not directly useful in Swift,
CFunctionPointer<T>
can be used to safely pass a C function pointer, received from one C or Objective-C API, to another C or Objective-C API.