Variadic templates
Bill Baxter
wbaxter at gmail.com
Thu Nov 2 18:43:21 PST 2006
Walter Bright wrote:
> Craig Black wrote:
>
>> This feature seems to supercede older versions of variadic functions.
>> Are there still reasons to use the older approach to variadics? If
>> not, should any of the older approaches ever be deprecated in order to
>> simplify the D language?
>
>
> That's a very good question, and I don't know the answer. writefln()'s
> current implementation may be obsolete. But it's premature to write its
> obituary. Let's see how things unfold a bit first.
Definitely too early to kill runtime variadics just because there are
now compile time ones. writefln is an especially good example of why
not. In a stdio heavy app it can get called in thousands of different
ways with different combination of argument types. Do you really want
each of those to be a separately instantiated function? It may run
slightly faster but the code size will be huge. No, writefln
definitely still has a place as-is.
--bb
More information about the Digitalmars-d
mailing list