This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Simplifing tuples
chris jefferson wrote:
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.
IMO, some kind of hard-wired maximum is ok, or better said, *far* better
than an harder-wired 10 ;), that is templates actually written down in
the header for N in the range 0..10. Completely avoiding any limit would
be even better, of course, but my limited imperative mind cannot even
imagine how that could be possibly achieved...
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?
I'm open to any working proposal... If running at build time a small
program achieves flexibility in setting at build time the upper limit,
it's also ok (in principle) with me... Interesting, anyway, we don't
have anything similar, currently...
Good work!
Paolo.