Unofficial Hacker News companion — get notified on comment replies, and more.

In C++, = default and {} are not the same constructor (opens external site)

131 points by surprisetalk 7 days ago | lemire.me | 202 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (1)

  1. 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.