variadic args

Kirk McDonald kirklin.mcdonald at gmail.com
Thu Dec 7 10:06:54 PST 2006


novice2 wrote:
> can i pass variadig arguments from one function to other?
> siomething like:
> 
> void func1(...)
> {
>   func2(...);
> }
> 
> is it still not possible?
> 
> (sorry, i was asked this some time ago. but now i see array
> literals are mnaked and other good changes - may be this question
> changed too.)

The new variadic templates make this easy:

void func1(T ...)(T t) {
     func2(t);
}

-- 
Kirk McDonald
Pyd: Wrapping Python with D
http://pyd.dsource.org



More information about the Digitalmars-d-learn mailing list