goto a no-go?

Unknown kozzi11 at gmail.com
Tue Oct 1 04:52:31 PDT 2013


Manu píše v Út 01. 10. 2013 v 21:40 +1000:


> I'd say 90% of the time I find goto useful is when I need to bail from
> nested loops. I've often wondered if something like break(2) would be
> a more elegant solution to the breaking out of nested loops problem.

I use break SomeLabel for this situations:

FirstLoop: while(1)
{
    SecondLoop: while(1)
    {
        break FirstLoop;
    }
}





More information about the Digitalmars-d mailing list