3 ms·
But remember all C++ defaults are wrong, and so of course std::span isn't bounds checked While your Rust slice will yell at you (at runtime if it can't figure
by tialaramex 4y ago
But remember all C++ defaults are wrong, and so of course std::span isn't bounds checked
While your Rust slice will yell at you (at runtime if it can't figure it out at compile time) when you try to index into the fifteenth item in a ten item slice, C++ has Undefined Behaviour in this case.
- raverbashing 4y ago> But remember all C++ defaults are wrong Honest truth right here.
- germandiago 4y agoSome are not. Many are.
- BenFrantzDale 4y agoTrue. I love C++ but think “don’t pay for what you don’t use” should err on the side of safety over speed when it comes to what “pay” means. I’d rather `operator[]` be bounds-checked and occasionally have to call `v.data()[i]` or `v.unchecked_at(i)` when profiling justifies it.