From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2002-08-06 18:23:19
Yes, varable-lenth template parameter lists are definitely useful,
there are typelists, typles, ... as partial solutions for not having
direct support for that.
But we were questioning whether having a variable number of _named_
template parameters is useful, I think not.
There you pretty much have to know the names of your features you may
expect the user to provide, and then you know the maximum number
of template parameters too.
Obviously one, or more, of the named template parameters may contain a
> >>- The use of typelists allows an arbitrary number of template
> >> parameters. I can't say with absolute certainty until I play
> >> around with this some more, but I think I can get all of the
> >> functionality of the sandbox NTP with the typelist mechanism.
> > There is no need for this. At design time you know how many template
> > parameters (or features) are be needed.
> I've been kicking this around a bit. Wouldn't it allow some
> decoupling of template parameter processing (the "class
> metaimplementation") from the class interface, similar to the
> pimpl idiom? Now, in all practicality it might not work
> because of compiler limitations, but I see an analogy between
> pimpl and typelists. Just as pimpl provides a single entry
> point to an arbitrarily complex data structure, a typelist
> provides a single (template parameter) entry point to an
> arbitrarily complex data structure of types.
> This sort of thing can allow template interface wrappers
> around template impl classes.
> Maybe it's not all that useful but it's fun to think about. :)
> In any event, I've seen calls in various places (c.l.c++.m
> and here, I think) for variable-length template parameter
> lists. What are those good for? Typelists seem to provide
> the same functionality. Well, in the same way std::vector
> provides variable-length function argument lists. :)
> Again, thanks for your comments.
-- -- -- Jaakko Järvi email: jajarvi_at_[hidden] -- Post Doctoral Fellow phone: +1 (812) 855-3608 -- Pervasive Technology Labs fax: +1 (812) 855-4829 -- Indiana University, Bloomington
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk