October 03, 2011 Re: Any way to use static foreach on multiple types? | ||||
---|---|---|---|---|
| ||||
On 10/3/11, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
> import std.typetuple;
> alias TypeTuple!(int, double) Types;
>
> void main()
> {
> foreach (T1, T2; Types, Reverse!Types)
> {
> }
> }
Oh I just figured out I'll have better coverage with nested foreach loops. I can just use this:
foreach (T1; Types)
foreach (T2; Reverse!Types)
{
}
That pretty much solves my problem.
|
Copyright © 1999-2021 by the D Language Foundation