Boost logo

Boost :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2006-10-01 20:17:26


On Oct 1, 2006, at 2:52 PM, Larry Evans wrote:

> On 08/04/2006 04:54 PM, Doug Gregor wrote:
> [snip]
>> I have just completed implementing support for "Variadic
>> Templates" in GCC. Variadic templates are C++ templates that can
>> accept any number of "extra" template arguments, just like a
>> function that uses C-style varargs (with "...") can accept any
>> number of extra arguments. Unlike C varags, however, variadic
>> templates work both for class templates and function templates,
>> and are completely type-safe.
> Doug, I read:
>
> http://www.osl.iu.edu/~dgregor/cpp/variadic-templates.pdf
> section 3.2 on p. 8.
>
> and thought I'd try this initialization, but with the attached I got:
>
> /home/evansl/download/gcc/variadic-templates/gcc-4.1.1/install/bin/g
> ++ -c -Wall -ftemplate-depth-100 -O0 -fno-inline -I/home/evansl/
> prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates -
> I"../../../../.." -I"../../../../../../.." vinit.cpp -o vinit.gccv.o
> vinit.cpp:17: error: too many initializers for 'test'
> make: *** [vinit.gccv.o] Error 1
>
> What am I doing wrong?

Well, you're not doing anything wrong. That section of the proposal
was meant to be a "if the initializer lists proposal is accepted,
then it would act like this." I didn't actually mean to propose any
changes to the initializer syntax, and so I didn't implement them.
(That said, it's a relatively simple feature to implement, if we need
it to test something out).

> TIA. (BTW, this is a great addition to the language!)

Thanks!

        Cheers,
        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk