What does std::string_view provide?
- A A non-owning read-only view of a character sequence, avoiding a copy
- B A mutable string buffer
- C A thread-safe string
- D An encrypted string
Answer
A non-owning read-only view of a character sequence, avoiding a copy
Because it does not own the data, a string_view must never outlive the buffer it refers to, which is a common dangling bug.





