Boost logo

Boost :

From: scleary_at_[hidden]
Date: 2001-04-05 07:34:46

> Right now, people usually rely on a program to generate these templates
> up to N arguments, where N is some small number. Often, to be able to deal
> with const and volatile reference arguments there is a combinatorial
> explosion. To deal with these cases effectively would require some kind of
> core language change, which, if I could turn back the clock, I would
> probably call "template templates". Anyway, I don't really have a good
> of the syntax for specifying such things, but I know there's a real need
> waiting to be filled... somehow.

I've had to deal with this, too. I dislike using any kind of external
program (even one written in C++) to generate C++ code; I'd rather generate
it using templates if at all possible.

In some cases, just having a #FOR (preprocessor directive) would be enough;
but for the general case, you would need to create code at template
instantiation time.

If the syntax for "template-time code generation" could be worked out, I'm
hoping one would be able to use what Bjarne's currently working on to
determine all the parameters (meaning the parameters of constructors of base
classes, etc.).

Interesting thoughts... maybe they'll be in C++ 2010 :)


Boost list run by bdawes at, gregod at, cpdaniel at, john at