How to redirect variadic function parameters?

Robin Allen r.a3 at ntlworld.com
Mon Feb 19 12:43:31 PST 2007


Anders F Björklund wrote:
> Bill Baxter wrote:
> 
>> You have to create a different, non-variadic function that takes 
>> _arguments and _argptr as arguments.
>>
>> See for example writefx in phobos/std/stdio.d:
>>    void writefx(FILE* fp,
>>                 TypeInfo[] arguments, void* argptr,
>>                 int newline=false);
> 
> The portable version uses "std.stdarg.va_list" instead:
> void writefx(FILE* fp, TypeInfo[] arguments, va_list argptr, int 
> newline=false);
> 
> Should be the same for DMD, but is a built-in for GDC.
> (need to use va_arg, instead of pointer manipulations)
> 
> --anders
> 
> http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Function#PortabilityandVariadicFunctions 
> 

Is there any reason why bar(...) couldn't be implemented? It's a mich 
nicer syntax.


More information about the Digitalmars-d-learn mailing list