4 ms·
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 ar
by ragnot 4y ago
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.
- imron 4y agoSure 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.