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

The issue is not "structs" v. "classes" per se, it's things like inheritance, vtables and RTTI (also other C++ features like templates and exceptions), that need special ABI support in C++ for which there is no Rust-side equivalent. (meanwhile Rust traits are quite different from anything in C++, although they're used similarly)


None of those things are required for a class. I'll admit they are all useful at time, but all are abused.


It largely depends on the definition of "class" you're using. You'll raise some eyebrows calling structs that can't support implementation inheritance "classes".

You can also have implement different associated functions based on properties of generic arguments, which is quite different in design from just attaching methods to a struct.




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

Search: