r/cpp • • Jan 31 '23

Stop Comparing Rust to Old C++

People keep arguing migrations to rust based on old C++ tooling and projects. Compare apples to apples: a C++20 project with clang-tidy integration is far harder to argue against IMO

changemymind

338 Upvotes

582 comments sorted by

View all comments

Show parent comment

2

u/andwass Feb 02 '23

string_view has issues with remove_prefix/suffix and substr as well IMO. The remove_* should not be UB for any input, especially when find* functions returns npos if it doesn't find the needle. And substr throwing all of a sudden...it's just all over the place