News for hackers. Stuff that matters.
Re:Safety: A comparaison between Rust, C++ and Go by snovv_crash on Saturday July 30, 2022 @08:14AM (#32286196)
You can also 'const' your std::vector when you declare it and it won't work. Any linter or having warnings turned on will catch these issues.
Re:Safety: A comparaison between Rust, C++ and Go by jstimpfle on Saturday July 30, 2022 @08:40AM (#32286322)
const doesn't make a difference in this case. It's about the passed-by-reference object being destroyed after the function returns. That is because the object was passed as a temporary.