| Thread overview | |||||
|---|---|---|---|---|---|
|
January 07, 2015 Enumerator Alias-Skipping Dynamic Iteration of Enum Members | ||||
|---|---|---|---|---|
| ||||
How do I make
foreach (E; EnumMembers!T)
- iterate dynamically instead of statically (no loop unrolling) and
- skip enumerator aliases?
| ||||
January 07, 2015 Re: Enumerator Alias-Skipping Dynamic Iteration of Enum Members | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | Nordlöw:
> How do I make
>
> foreach (E; EnumMembers!T)
>
> - iterate dynamically instead of statically (no loop unrolling) and
> - skip enumerator aliases?
Try:
foreach (immutable e; [EnumMembers!T].sort().uniq)
Bye,
bearophile
| |||
January 07, 2015 Re: Enumerator Alias-Skipping Dynamic Iteration of Enum Members | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Wednesday, 7 January 2015 at 18:27:48 UTC, bearophile wrote:
> foreach (immutable e; [EnumMembers!T].sort().uniq)
Thanks!
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply