iterate over variadic

drug via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 9 15:40:34 PDT 2017


10.07.2017 01:21, FoxyBrown пишет:
> How can we iterate over a variadic and have it's index. I'll do 
> different things depend on if it's an even or odd index, but seems to be 
> no way to get it.
> 

auto foo(Types...)()
{
	foreach(T; Types)
	{
		// do what you need
	}
}
index could be added like usual


More information about the Digitalmars-d-learn mailing list