← Top stories 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 (3) pwdisswordfishq | 2 days ago | parent | reply Rule of Zero is not actually about constructors other than the move and copy constructors. Replies (1) wavemode | 2 days ago | parent | reply Rule-of-zero classes don't need regular constructors either, since you can just aggregate-initialize them.If more logic surrounding their construction is needed, you can use factory functions. Replies (1) xscott | 2 days ago | parent | reply You said it better than I did. What I tried to say (and failed) was that there's a style of C++ application code that doesn't need to do any of it: no constructors, assignments, or destructor. Sometimes library code needs those though.
Replies (1)
If more logic surrounding their construction is needed, you can use factory functions.
Replies (1)