@jonbro the *only* semantic difference between classes and structs in c++ is class members are private by default and struct members are public by default. otherwise the two forms are totally identical. the only perf overhead is when you use virtual functions because then you need a vtable. the perf overhead is because virtual functions are function pointers. that's all
@aeva the thing I'm wondering about is the difference between a class and a struct that is inside extern "C" {}
will those have effectively the same memory footprint?
I'm guessing that instance.function() is roughly equivalent to function(&instance) as well.
@jonbro i think this is why so many programmers think struct is special, because if you don't use any c++ism you get a "plain old data" layout
@jonbro i can't think of any reason why a modern c++ compiler would reject one and not the other, certainly not enums. perhaps you had some other bug that you accidentally fixed when reworking the struct?
@jonbro i guess that's the c way? typedef is not doing any special work here for structs. the struct { ... } form is just a type definition. you could also do alias name = struct { ... }; if you really wanted to be silly