I agree with your general sentiment, but imo this particular example is oversold. Maybe I'm wrong.
The difference between const ref string and string view is one of the first things you learn when you learn about `string view`.
To me, the signature of `Sanitize` is fishy because it's implied that the returned string view is of the const ref string argument. But I agree there are more than one ways to break it.
The difference between const ref string and string view is one of the first things you learn when you learn about `string view`.
To me, the signature of `Sanitize` is fishy because it's implied that the returned string view is of the const ref string argument. But I agree there are more than one ways to break it.