Unofficial Hacker News client - receive Push Notifications on replies.

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

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

View full thread · View on Hacker News

Comment thread (1)

  1. Yes, the ergonomics are just better

    If you Vec::with_capacity(5) both you and a reviewer know what's going on here - this is clearly a Vec with capacity 5.

    When you call a C++ constructor with 5 as the parameter, both you and the reviewer had better be sure what that 5 means.