News for hackers. Stuff that matters.
Re:Why Don't You Use String Views Instead of Passing Std:Wst... by quotemstr on Wednesday April 01, 2026 @01:09AM (#47597057)
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.

Re:Why Don't You Use String Views Instead of Passing Std:Wst... by apparatur on Wednesday April 01, 2026 @02:22AM (#47597504)
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.
Re:Why Don't You Use String Views Instead of Passing Std:Wst... by pwdisswordfishy on Wednesday April 01, 2026 @02:46AM (#47597681)
Or wait until P3655 ships, which will bring std::wcstring_view.