Hacker News new | ask | show | jobs
by pwdisswordfishq 7 days ago
Rule of Zero is not actually about constructors other than the move and copy constructors.
1 comments

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.

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.