2010/11/16 Jesse Phillips <jessekphillip...@gmail.com>: > While it might be better to update existing projects, here are some answers. > > Alexey Khmara Wrote: > >> I want there to call appropriate overloaded function for each item of >> args tuple, but I was not able to do this without mixin - compiler >> gives syntax errors when I try to write something like "args[i] = >> getValue!T[i](i);" > > Try using: getValue!(T[i])(i), the !() shortcut doesn't work with arrays. > Might be a bug, but I don't think it necessarily should. > >> Also if I try to assign to arg, and not args[i], changes are not >> propagated to variables given as function arguments, even if I have >> foreach(ref... syntax. Is it a bug or I just don't understand >> something? > > Not sure what your ref syntax looks like, but it should be like below. > > foreach(i, ref arg; args) { >
I tried to use this: foreach(ref i, arg; args) { I was stupid - don't realized that ref affects only one argument, not all of them :-) Thanks, for suggestions, all works good now :-) But strangely, assign not to arg, but to args works also, this line: args = getValue!(T[i])(i); gets compiled and gives correct results... Not a bad, but I cannot understand why - seems like assigning one value to tuple... -- WBR, Alexey Khmara