When should I use a struct
instead of a class? I\'m currently using classes for everything from OpenGL texture wrappers to bitmap fonts.
Is
as others have explained, they're the same thing except for default access levels.
the only reason why classes can be perceived to be slower is because a good style (but not the only one) is the one mentioned by ArmenTsirunyan: struct
for POD types, class
for full-fledged object classes. The latter ones usually include inheritance and virtual methods, hence vtables, which are slightly slower to call than straight functions.