> -----Original Message----- > From: Martin Sebor [mailto:[EMAIL PROTECTED] On Behalf Of Martin Sebor > Sent: Friday, June 27, 2008 3:05 PM > To: [email protected] > Subject: [VOTE] naming convention for variadic template > arguments (was: Re: svn commit: r668318 - in > /stdcxx/branches/4.3.x: include/rw/_tuple.h > include/rw/_tuple_traits.h include/tuple > tests/utilities/20.tuple.cnstr.cpp) > > This thread kind of fizzled out so let me resurrect it and reiterate > the proposed naming convention to follow unless more specific names > are appropriate: > > template <class _TypeT, class... _Types> # 1 > > This is in contrast to other styles, including: > > template <class _Type, class... _Types> # 2 > template <class _HeadT, class... _TailT> # 3 > template <class _TType, class... _UTypes> # 4 > > The rationale for the proposed convention (#1) is that: > > A) unlike the alternatives, the first name (_TypeT) follows > a well-established and entrenched convention for template > parameters used throughout the library > B) also unlike the alternatives, it is being used in the > implementation of <type_traits> > C) unlike (#2) (although not as well as #3) it more clearly > distinguishes between the name of the first parameter and > the parameter pack > > Check the box below to vote: > > [ ] In favor > [x] Opposed (suggest an improvement and rationale)
In this case, it depends on whether the two parameters are actually part of the same type list. If _TypesT and _Types are actually part of the same type list then they should be named either _TypeT and _TypesT respectively (or _Type and _Types as shown in #2). If they are not part of the same type list, then they should be named _TypeT and _TypesU (similar to #4). In any case, a plural name should implicitly denote a template parameter pack (which actually should rule out #3 even though I've already been using it). :P Brad.
