On Sunday, 23 September 2012 at 22:29:31 UTC, jerro wrote:
On Sunday, 23 September 2012 at 21:37:06 UTC, Adam D. Ruppe wrote:
I'm not for removing the comma operator, but it occurs to me we could do it in the library:

auto commaOperatorReplacement(T...)(T t) {
  return t[$-1];
}

There might be some edge case where that wouldn't work, but I think it works in most cases.

If D is like C in this regard, then the function above cannot replace comma operator, because the order of evaluation is defined for comma operator, but not for function parameters. You could use something like that, though:

Sorry about the "You could use something like that, though" part. I realized "something like that" wouldn't work either, but forgot to delete that text.

Reply via email to