4 ms·
Yes, `std::string` owns its own copy of the string in typical implementations (as does Rust's `String` type). `std::string_view` references that copy. `std::st
by umanwizard 7y ago
Yes, `std::string` owns its own copy of the string in typical implementations (as does Rust's `String` type).
`std::string_view` references that copy. `std::string::clear` destroys it, leaving the `std::string_view` dangling.