protocol
CVarArgType
Inheritance | View Protocol Hierarchy → |
---|---|
Import |
|
Instance Methods
Transform self
into a series of machine words that can be
appropriately interpreted by C varargs
Declaration
func
encode
() -
>
[
Word
]
Instances of conforming types can be encoded, and appropriately passed, as elements of a C
va_list
.This protocol is useful in presenting C "varargs" APIs natively in Swift. It only works for APIs that have a
va_list
variant, so for example, it isn't much use if all you have is:Given a version like this, though, :
you can write: