<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
variadic	B-Language
templates	I-Language
are	O
templates	B-Application
that	O
take	O
a	O
variable	O
number	O
of	O
arguments	O
.	O
</s>
<s>
Variadic	B-Language
templates	I-Language
are	O
supported	O
by	O
C++	B-Language
(	O
since	O
the	O
C++11	B-Language
standard	O
)	O
,	O
and	O
the	O
D	B-Application
programming	I-Application
language	I-Application
.	O
</s>
<s>
The	O
variadic	B-Language
template	I-Language
feature	O
of	O
C++	B-Language
was	O
designed	O
by	O
Douglas	O
Gregor	O
and	O
Jaakko	O
Järvi	O
and	O
was	O
later	O
standardized	O
in	O
C++11	B-Language
.	I-Language
</s>
<s>
Prior	O
to	O
C++11	B-Language
,	O
templates	B-Application
(	O
classes	O
and	O
functions	O
)	O
could	O
only	O
take	O
a	O
fixed	O
number	O
of	O
arguments	O
,	O
which	O
had	O
to	O
be	O
specified	O
when	O
a	O
template	B-Application
was	O
first	O
declared	O
.	O
</s>
<s>
C++11	B-Language
allows	O
template	B-Application
definitions	O
to	O
take	O
an	O
arbitrary	O
number	O
of	O
arguments	O
of	O
any	O
type	O
.	O
</s>
<s>
The	O
above	O
template	B-Application
class	O
will	O
take	O
any	O
number	O
of	O
typenames	O
as	O
its	O
template	B-Application
parameters	O
.	O
</s>
<s>
Here	O
,	O
an	O
instance	O
of	O
the	O
above	O
template	B-Application
class	O
is	O
instantiated	O
with	O
three	O
type	O
arguments	O
:	O
</s>
<s>
If	O
the	O
variadic	B-Language
template	I-Language
should	O
only	O
allow	O
a	O
positive	O
number	O
of	O
arguments	O
,	O
then	O
this	O
definition	O
can	O
be	O
used	O
:	O
</s>
<s>
Variadic	B-Language
templates	I-Language
may	O
also	O
apply	O
to	O
functions	O
,	O
thus	O
not	O
only	O
providing	O
a	O
type-safe	O
add-on	O
to	O
variadic	B-Language
functions	I-Language
(	O
such	O
as	O
printf	O
)	O
,	O
but	O
also	O
allowing	O
a	O
function	O
called	O
with	O
printf-like	O
syntax	O
to	O
process	O
non-trivial	O
objects	O
.	O
</s>
<s>
Using	O
the	O
parameter	O
pack	O
,	O
the	O
user	O
can	O
bind	O
zero	O
or	O
more	O
arguments	O
to	O
the	O
variadic	B-Language
template	I-Language
parameters	O
.	O
</s>
<s>
By	O
contrast	O
,	O
when	O
the	O
ellipsis	O
operator	O
occurs	O
to	O
the	O
right	O
of	O
a	O
template	B-Application
or	O
function	O
call	O
argument	O
,	O
it	O
unpacks	O
the	O
parameter	O
packs	O
into	O
separate	O
arguments	O
,	O
like	O
the	O
in	O
the	O
body	O
of	O
below	O
.	O
</s>
<s>
The	O
use	O
of	O
variadic	B-Language
templates	I-Language
is	O
often	O
recursive	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
typical	O
mechanism	O
for	O
defining	O
something	O
like	O
a	O
C++11	B-Language
variadic	O
replacement	O
would	O
be	O
as	O
follows	O
:	O
</s>
<s>
This	O
is	O
a	O
recursive	O
template	B-Application
.	O
</s>
<s>
Notice	O
that	O
the	O
variadic	B-Language
template	I-Language
version	O
of	O
calls	O
itself	O
,	O
or	O
(	O
in	O
the	O
event	O
that	O
is	O
empty	O
)	O
calls	O
the	O
base	O
case	O
.	O
</s>
<s>
There	O
is	O
no	O
simple	O
mechanism	O
to	O
iterate	O
over	O
the	O
values	O
of	O
the	O
variadic	B-Language
template	I-Language
.	O
</s>
<s>
Usually	O
this	O
will	O
rely	O
on	O
function	B-Language
overloading	I-Language
,	O
or	O
—	O
if	O
the	O
function	O
can	O
simply	O
pick	O
one	O
argument	O
at	O
a	O
time	O
—	O
using	O
a	O
dumb	O
expansion	O
marker	O
:	O
</s>
<s>
Variadic	B-Language
templates	I-Language
can	O
also	O
be	O
used	O
in	O
an	O
exception	O
specification	O
,	O
a	O
base	O
class	O
list	O
,	O
or	O
the	O
initialization	O
list	O
of	O
a	O
constructor	O
.	O
</s>
<s>
With	O
regard	O
to	O
function	O
templates	B-Application
,	O
the	O
variadic	O
parameters	O
can	O
be	O
forwarded	O
.	O
</s>
<s>
Additionally	O
,	O
the	O
number	O
of	O
arguments	O
in	O
a	O
template	B-Application
parameter	O
pack	O
can	O
be	O
determined	O
as	O
follows	O
:	O
</s>
<s>
The	O
definition	O
of	O
variadic	B-Language
templates	I-Language
in	O
D	B-Application
is	O
similar	O
to	O
their	O
C++	B-Language
counterpart	O
:	O
</s>
<s>
Variadic	B-Language
templates	I-Language
are	O
often	O
used	O
to	O
create	O
a	O
sequence	O
of	O
aliases	O
,	O
named	O
.	O
</s>
<s>
This	O
includes	O
values	O
,	O
types	O
,	O
functions	O
or	O
even	O
non-specialized	O
templates	B-Application
.	O
</s>
