Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string s {"abcd"};
- std::string_view v {s.c_str()};
- std::cout << "ctor: " << v << std::endl; // "abcd"
- v = {s.c_str() + 1, 2};
- std::cout << "assign: " << v << std::endl; // "bc"
- v = {nullptr};
- std::cout << "clear: " << v << std::endl; // ""
Add Comment
Please, Sign In to add comment