3 ms·
I guess the benefit of Rust in this case is that you will get an index out of bounds error rather than Undefined Behaviour.
by nicoburns 4y ago
I guess the benefit of Rust in this case is that you will get an index out of bounds error rather than Undefined Behaviour.
- cyber_kinetist 4y agoYou can also check index out of bounds in C++ code, and you actually have more freedom to control it in C++. In Rust bounds checks are required unless you use unsafe, in C++ you can turn it on/off freely depending on your usecase (for example, when you are in debug mode vs. deploying your code).