"simendsjo" <[email protected]> wrote in message 
news:op.wanctrbux8p62v@simendsjo-desktop...
> Hi.
> I have the following code:
> void f(Args...)(Args args) {
>   needs_wchar_t(args);
> }
>
> I want to loop over Args, and if it's a string of some type, I want to run 
> it through toUTFz. For all other values, I just want to push them as 
> normal.
> How could I solve this?

With a loop?

void f(Args...)(Args args) {
  foreach(i, T; Args)
  {
    static if (isSomeString!T) args[i] = toUTFz(args[i]);
  }
  needs_wchar_t(args);
}


Reply via email to