4 ms·
I don't know C++, so sorry if this is a dumb question: what's the difference between a tuple with named fields and a struct?
by gnuvince 11y ago
I don't know C++, so sorry if this is a dumb question: what's the difference between a tuple with named fields and a struct?
- plorkyeran 11y agoYou can do metaprogramming things like iterate over the fields of a tuple or unpack it into the arguments of a function, but you can't with a struct (without manually defining an array of fields).
- melted 11y agoYou use this if you want to _appear_ smart, and you use structs if you actually _are_ smart. Smart programmers do not introduce gratuitous complexity into their code.