unsafeBitCast

func unsafeBitCast(_:to:)(_ x: T, to type: U.Type) -> U

Returns the bits of the given instance, interpreted as having the specified type.

Use this function only to convert the instance passed as x to a layout-compatible type when conversion through other means is not possible. Common conversions supported by the Swift standard library include the following:

Warning: Calling this function breaks the guarantees of the Swift type system; use with extreme care.