News for hackers. Stuff that matters.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by steveklabnik on Wednesday March 31, 2021 @01:05PM (#26649869)
So, I dug into this a bit more, and you're right!

https://www.fluentcpp.com/2017/06/13/the-real-difference-bet...

Maybe it was the era that I learned C++ (which was in the 98 days), but I was taught something closer to this convention, and didn't realize until just now there was such little difference by the book. Just bundling some data together? Use a struct. Doing more? Use a class.

I still think this distinction is useful overall, because there often is more of one in many languages, but I will be more precise when speaking about C++ specifically in the future. I would also still argue the same thing overall, that is, Rust does not have what C++ calls classes. Our structs are apparently even simpler than C++ structs.

Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by logicchains on Thursday April 01, 2021 @01:45AM (#26657024)
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by oriolid on Wednesday March 31, 2021 @01:43PM (#26650435)
It certainly makes sense to use struct and class to indicate what the type's role is. It's just good to keep in mind to avoid the confusion when you find the struct that has only pure virtual functions as members.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by est31 on Wednesday March 31, 2021 @03:04PM (#26651574)
C++ has to have structs because it wants to be (mostly) backwards compatible with C. I think that's the main reason they exist in C++.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by pjmlp on Wednesday March 31, 2021 @04:56PM (#26653081)
That is correct.