Proposal of a general do-while loop

downs default_357-line at yahoo.de
Tue Jul 17 09:27:02 PDT 2007


downs wrote:
> void doWhile(void delegate() pre, lazy bool cond, void delegate() post) {
>   while (true) {
>     pre;
Er, naturally, that has to be pre();
>     if (!cond()) break;
>     post;
And post();
>   }
> }



More information about the Digitalmars-d mailing list