Am Sun, 16 Jun 2013 04:22:59 +0200 schrieb "TommiT" <tommitiss...@hotmail.com>:
> On Sunday, 16 June 2013 at 00:19:37 UTC, Manu wrote: > > Super awesome idea! How about coma separated expressions to > > perform > > multiple asserts? > > > > int func(int i, int j) in(i<5, j<10) > > { > > return i + j; > > } > > Do you mean ...to get more specific error messages than with > in(i<5 && j<10) ? Actually these are 2 great ideas. Make that expand to: in { assert(i<5, __FUNCTION__ ~ ": precondition i<5 failed. Variables: i == " ~ to!string(i)); assert(j<10, __FUNCTION__ ~ ": precondition j<10 failed. Variables: j == " ~ to!string(j)); } -- Marco