This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Simplifing tuples
- From: chris jefferson <caj at cs dot york dot ac dot uk>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sun, 10 Oct 2004 19:01:06 +0100
- Subject: Re: Simplifing tuples
- References: <4167C752.7040405@cs.york.ac.uk> <4168FC3B.1030509@suse.de>
Paolo Carlini wrote:
chris wrote:
I'm currently working my way through implementing this, writing a
sizeable test suite, etc. I just wondered if anyone had any positive
/ negative comments on this kind of unfolding?
Something I'm wondering about is whether we can provide to the user a
*simple* way to *set* (at library build time) the maximum number of
elements in one tuple type, not just 10, as mandated by the standard,
or an arbitrary number decided by the implementors: AFAICS this is not
possible neither with boost reference implementation, neither with
your proposal. Of course, it's something highly not trivial,
preprocessor magic and/or sophisticated template metaprogramming
techniques would be needed, but eventually the QoI would be much
higher, IMHO...
.
Actually, with my current iml[ementation this owuld be possible, as I
have a c++ program (although this could easily be converted to C) which
generates the tuple header takes a parameter which defines the maximum
size of tuple. I'm curerntly testing with this parameter set to 3 so
it's easier to see whats going on and debug. I suspect it could be done
with preprocessor and templateness, but it wouldn't be very pretty :)
And like all processor magic it would still require some kind of
hard-wired maximum.
I'm still torn on wether I should generate the header with C or with
template metaprogramming. Having discussed it with a few people, the
arguments fall into one of two categories:
1) Why write a C program to output the header when you could do it with
templates?
2) Why write complex templates to generate the tuples when you could
just write a simple C program to output the header?
:)
Chris