logoalt Hacker News

nvme0n1p1today at 4:17 PM1 replyview on HN

You don't need to use @bitCast for the behavior you're talking about. @ptrCast still exists.


Replies

ozgrakkurttoday at 6:09 PM

@ptrCast,

> Converts a pointer of one type to a pointer of another type. [1]

[1] https://ziglang.org/documentation/master/#toc-ptrCast

So it is not the same.

You could use it to define a function that implements bitCast. Which defeats the purpose of having any @bitCast intrinsic instead of using @mempcy for everything

show 1 reply