logoalt Hacker News

quotemstrtoday at 5:09 AM2 repliesview on HN

It's usually the case that the more strident someone is in a blog post decrying innovation, the more wrong he is. The current article is no exception.

It's possible to define your own string_view workalike that has a c_str() and binds to whatever is stringlike can has a c_str. It's a few hundred lines of code. You don't have to live with the double indirection.


Replies

pwdisswordfishytoday at 6:46 AM

Or wait until P3655 ships, which will bring std::wcstring_view.

apparaturtoday at 6:22 AM

I think the article is trying to address the question from the title. Definining your own string_view workalike is probably possible, but I'm not sure if it's OK to use it in a public API, for example. Choosing to use const string & may be more suitable.