@ptrCast

@ptrCast

@ptrCast(comptime DestType: type, value: var) DestType

Converts a pointer of one type to a pointer of another type.

Optional Pointers are allowed. Casting an optional pointer which is null to a non-optional pointer invokes safety-checked Undefined Behavior.