3 ms·
You can iterate on the tuple and know it size, not on the struct (unless you use Boost.Fusion or something equivalent).
by shin_lao 11y ago
You can iterate on the tuple and know it size, not on the struct (unless you use Boost.Fusion or something equivalent).
- leni536 11y agoYeah, tuples make sense sometimes, that's why they are introduced. I think iterating through a tuple only makes sense if you store in some kind "similar" elements in there (not necessarily same type but same trait class). It could indeed be great for generic programming where your tuple have variadic length (depending on template parameters). Just don't use it to replace structs, it doesn't make sense.