Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If this is true, there is nothing that forces you to write classes in C++. You have all the freedom to write only in functions and structs.

Except that abstract classes are pretty much the only way to implement type-checked interfaces and they are, well, classes.



Not at all. You can use CRTP, you can use structs, you can use SFINAE, etc.

UPDATE: And for the record, inherence of pure interface classes works just fine in C++. The stuff where it gets ugly is when you try building a deep inheritance hierarchy of behaviour. It can work, but usually not terribly well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: