Function accepting variadic arguments
Daniel Kozak via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Jan 20 05:09:13 PST 2016
On Wednesday, 20 January 2016 at 13:06:14 UTC, pineapple wrote:
> On Wednesday, 20 January 2016 at 12:56:51 UTC, Ali Çehreli
> wrote:
>> And there is another example here:
>>
>>
>> http://ddili.org/ders/d.en/templates_more.html#ix_templates_more.tuple%20template%20parameter
>>
>> Ali
>
> Thank you!
>
> What's the purpose of "is" in the type checks?
is is use for compare types
>
> Also, how would I utilize isNumeric from std.traits here, in
> place of checking only for ints?
struct S
{
this(Args...)(Args args)
{
foreach(Index, Value;args)
{
if (isNumeric!(Args[index]))
{
...
}
}
}
}
More information about the Digitalmars-d-learn
mailing list