2 ms·
Sure, but that's not the string_view's problem, you can't just make string_views, the string you want to borrow a view into needs to exist first. Imagine you g
by tialaramex 4y ago
Sure, but that's not the string_view's problem, you can't just make string_views, the string you want to borrow a view into needs to exist first.
Imagine you go to a library and insist on borrowing "My Cousin Rachel", but they don't have it. "Oh I don't care whether you have the book, I just want to borrow it" is clearly nonsense. If they don't have it, you can't borrow it.
- saagarjha 4y agoWalter is talking about D, and he said this: > D doesn't distinguish between a string and a string view. In C++ std::string owns the buffer and std::string_view borrows it. If there is no difference between the two in D, then how is this difference bridged?