2 ms·
> Go does this. Rust should, and probably will soon. LLVM does optimize these out, and in more cases than Go does. > C++ can't do that because the compiler do
by pcwalton 11y ago
> Go does this. Rust should, and probably will soon.
LLVM does optimize these out, and in more cases than Go does.
> C++ can't do that because the compiler doesn't know that a template-implemented bounds check is a bounds check.
It doesn't need to. SCCP is a very general optimization. GCC and LLVM optimize out bounds checks in more cases than Go can do.