Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template Tuple (E...)
- {
- alias Tuple = E;
- }
- void main ()
- {
- // Would be a string tuple.
- alias SomeTuple = Tuple!();
- int[string] map = [];
- // Does not work. `i` is not known at compile time. Intentional.
- // `foreach (int i, string e; SomeTuple)` would make it work.
- for (int i = 0; i < SomeTuple.length; ++i)
- {
- // This crashes DMD.
- auto a = map[SomeTuple[i]];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement