Panther Search Documentation Tutorials Devlogs Downloads Source Code

Documentation > Panther Documentation > Intrinsics > @bitCast

@bitCast

Panther
Documentation


1: func @bitCast = <{FROM: Type, TO: Type}> (from: FROM) #unsafe -> TO;

  Bitwise convert a value of any type to any other tpe of the same size. Requires that @numBytes<{FROM, true}>() == @numBytes<{TO, true}>().

Template Parameters

  FROM: type to convert from - cannot be type Void

  TO: type to convert to - cannot be type Void

Parameters

  from: value to convert

Return Value

  Returns converted value

Example

(TODO)