Passing a variable number of slices into a function

repr-man jxl.ppg at gmail.com
Mon Jun 22 01:47:49 UTC 2020


Is there any way to pass an unknown number of slices into a 
function?  I'm trying to do something along the lines of:

void func(T)(T[] args...)
{
     //...
}

That wasn't working, so I tried using another generic type where 
T was already defined:

void func(U)(U args...)
if(is(U == T[])
{
     //...
}

This didn't work either, so I wanted to know if I was going in 
the right direction or if I was missing something obvious.

Thanks for the help!


More information about the Digitalmars-d-learn mailing list