daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. std::string s {"abcd"};
  2. std::string_view v {s.c_str()};
  3. std::cout << "ctor:   " << v << std::endl; // "abcd"
  4. v = {s.c_str() + 1, 2};
  5. std::cout << "assign: " << v << std::endl; // "bc"
  6. v = {nullptr};
  7. std::cout << "clear:  " << v << std::endl; // ""
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top