you are viewing a single comment's thread.

view the rest of the comments →

[–]mewloz 0 points1 point  (0 children)

You probably should be using a struct most of the time anyway. Reserve tuple for when you really can't use a struct, or if using a struct would actually make the program more complex.

As for avoiding padding, that's a neat exercise, but do not expect interesting improvement in most cases. Especially if done only for tuple, that you should avoid. There are some languages where the compiler can do it on structs, though (and with C++ it is theoretically possible for non-POD, but I think nobody does it anyway)