▲ | unwind 5 days ago | ||||||||||||||||
Can the compiler detect that and use the proper code so no test is needed at runtime? This is Zig so I guess the answer is "yeah, duh" but wanted to ask since it sounded like the solution is less, uh, "compiler-friendly" than I would expect. | |||||||||||||||||
▲ | hansvm 5 days ago | parent [-] | ||||||||||||||||
Yes, and if you're paranoid you can write
to guarantee that if you're wrong about how the compiler behaves then you'll get a compiler error. | |||||||||||||||||
|