Y
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
wavemode
7 days ago
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.
link
xscott
7 days ago
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.
link
If more logic surrounding their construction is needed, you can use factory functions.