How to call other variadic function with the same arguments?

Paul Backus snarwin at gmail.com
Mon Feb 25 01:29:12 UTC 2019


On Sunday, 24 February 2019 at 13:09:15 UTC, Victor Porton wrote:
> Let f be a variadic function:
>
> Result f(...);
>
> How to implement variadic function g which calls f with the 
> same arguments as one it receives?
>
> Result g(...) {
>   // ...
> }

If you must use C-style variadic arguments, then your only choice 
is to do it the same way you would in C: write a version of `g` 
that accepts a va_list (like vprintf(3)), and have `f` call that.


More information about the Digitalmars-d-learn mailing list