10 Jul
2009
10 Jul
'09
10:21 a.m.
Vladimir Prus wrote:
Robert Jones wrote:
I know that sounds like a slightly flippant question, but I really don't get it.
I've used tuples a few times, always for the multiple return value behaviour using tie( ), but in the end it always seems to be a better solution to use a struct. Code like
t.get<1>( ) = "fred";
is a bit non-obvious, compared to
t.forename = "fred";
So have I entirely missed the point of tuples?
FWIW, I've stopped using tuples because using indices as opposed to names turned out to a maintenance nightmare.
So, what's wrong with using named constants for the indices? That's what I've been most of the time when using tuples. / Johan