Graham Reitz wrote:
One of my colleagues has asked me, "why not use a simple struct over a tuple?"
Unfortunately, I couldn't give a convincing answer, which means I probably don't understand tuple well enough.
What is a good way to respond to this? Then we can identify when it makes better sense to use a struct versus a tuple.
In a word, "genericity". Yeah, there's no such word in the english dictionary, but I'm sure you know what I mean. When you want to treat something in a uniform manner, then you'll want to use tuples. Tuple genericity is exploited by the Boost.Fusion library such that you have iterators and algorithms that work on different tuple types (think STL for heterogeneous types). And it goes further! In Fusion a struct is a tuple. See: http://tinyurl.com/2ypbof Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net