Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: two's complement idea Date: Sun, 26 Jan 2020 19:06:29 -0800 Organization: None to speak of Lines: 29 Message-ID: <87blqp4myy.fsf@nosuchdomain.example.com> References: <4hBWF.107660$LY2.60603@fx23.am4> <%JhXF.102988$%G5.101221@fx03.am4> <49pr2fphchn3dk2hiqv2bk8ml5oijs0d6e@4ax.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="32718fc629afc982786b25f35dff2a9d"; logging-data="7020"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yZWjkcrsLTC8iK+4Bwk21" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:OlfW0BdzAMrTZov7kQV/8AIxUnc= sha1:UfDU3roOIn7Z+4OhJJ+nID58aBI= Xref: csiph.com comp.lang.c++:71609 Robert Wessel writes: > On Sun, 26 Jan 2020 20:51:46 +0000, Bart wrote: [...] >>If the inner loops are numbered from 1 (where the break statement is) to >>N (outermost loop), then you write the equivalent of: >> >> break; // or break 1 >> break 2 // next outer loop >> break N; // break out of all loops >> >>Not everyone likes applying an index like this (eg. you add or remove >>loops, and the numbers have to change); they prefer labeled statements. [...] > I like the labeled approach. The problem with the "level" approach is > that the insertion or deletion of a loop/switch in the hierarchy would > normally not change where you wanted to break to, but if you've > specified the break with a level, you *will* suddenly be breaking to a > different loop. The label makes the association with the loop/switch > of interest explicit. [...] My objection to the "break 2" approach is that it requires humans to count things. Computers are really really good at counting things. Let them. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */