|
|
|
|
|
by blub
2674 days ago
|
|
From your link: "C++ implementations obey the zero-overhead principle: What you don't use, you don't pay for". In Rust you pay for e.g. bounds checking or integer overflow handling or optionals.
But I don't understand why everyone's getting so defensive about this, since it's the only way (static verification and proofs aside) to get the desired safety characteristics... |
|
You can disable them in debug builds as well with wrapping integers. So this is again a practice of making the safer option the default, but won't incur runtime costs if it bothers you.
If there is a way to do it at compile time that will usually be used in rust.