version 0.0 (this will never need versioning so don’t worry about it)
I got tired of the endless casting in zig especially after the type arguemnts was removed from the casting functions in favor of using the expected return type. This can often lead to this string of verbose unnecessary casts, so I have slowly beed adding casting to this single casting function.
Will this cause bugs? Probably. It is a “do what I say and don’t questions my authority” kind of thing. If you want to cast that bool into a float, it will trust you.
It will make it easier to do pointer and bit manipulation.
There is no direction. I just add them as I need them, and if you want me to add something either post a PR or message me on reddit and I’ll see what I can do.
I do want to add zero-cost lvalue casts though since I find it quite annoying.
More to come… maybe… or not… but likely… kinda likely.
int, float, bool, enum -> int, float, bool, enum int, ptr -> int, ptr struct -> struct, int optional -> optional
cast(u32, 1243.4) cast(bool, 123) cast([*]u32, "asfd")