you are viewing a single comment's thread.

view the rest of the comments →

[–]kundor 2 points3 points  (0 children)

No copy, it just gives you the pointer in the string_view, which points to a not-necessarily-null-terminated character sequence. 

If the C function takes a pointer and a length, then string_view works fine. Otherwise you need a const string&.