Invokes the given closure with a C
va_list argument derived from the given array of arguments.
func withVaList<R>(_ args: [CVarArg], _ body: (CVaListPointer) -> R) -> R
An array of arguments to convert to a C
A closure with a
CVaListPointerparameter that references the arguments passed as
bodyhas a return value, that value is also used as the return value for the
withVaList(_:)function. The pointer argument is valid only for the duration of the function’s execution.
The return value, if any, of the
body closure parameter.
The pointer passed as an argument to
body is valid only during the execution of
withVaList(_:_:). Do not store or return the pointer for later use.
If you need to pass an optional pointer as a
CVarArg argument, use the
Int(bitPattern:) initializer to interpret the optional pointer as an
Int value, which has the same C variadic calling conventions as a pointer on all supported platforms.