bitCast(_:to:)
Returns the bits of the given instance, interpreted as having the specified type.
Declaration
func bitCast<T, U>(_ original: T, to type: U.Type) -> U where T : ConvertibleToBytes, U : ConvertibleFromBytesParameters
- original:
The instance to cast to
type. - type:
The type to cast
originalto.
Return Value
A new instance of type U, cast from original.
Discussion
T and U must have the same-sized memory representation. If they don’t, this function will trap.