logoalt Hacker News

dotancohentoday at 4:29 AM1 replyview on HN

Ban constructors? Though I don't agree with the practice, I could imagine a reason for banning destructors. But constructors? Why?


Replies

bsdertoday at 5:16 AM

Because the two go together. If you have to ban one, you pretty much have to ban both.

Although, I guess if you only statically allocated everything once at startup, you could use constructors without destructors? Presumably using the placement versions would also let you use constructors without destructors.

I'm generally talking about systems that are <64KB. You basically don't get heap and determinism is really important.

show 1 reply