News for hackers. Stuff that matters.
Re:It's time to halt starting any new projects in C/C++ by ragnot on Monday September 19, 2022 @10:12PM (#32906839)
I mean I get it. On the other hand you really should know the constructs you are using. std::string_view is essentially a reference to a char array and you are assigning a temporary object (r-value) to it. Standard C++ rules say that you can't expect the lifetime of that object hold past the expression.
Re:It's time to halt starting any new projects in C/C++ by imron on Monday September 19, 2022 @10:18PM (#32906883)
Sure I get it too.

If you want to write safe c++ you have to understand memory and lifetimes and what the code is doing. Humans have been shown to be quite bad at doing this - even experienced programmers.

Rust offloads that work to the compiler.