An unofficial, read-only Hacker News reader. Join the beta →

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

129 points by surprisetalk 2 days ago | lemire.me | 198 comments on HN

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.