Boost logo

Boost :

Subject: Re: [boost] [Boost.Breakable] Any interest in a Boost Breakable library?
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2009-09-06 12:10:44


Pierre Morcello wrote:
> Hello,
>
> I propose a set of macros that allow to break anywhere. Example of use of the main macro :
>
> // do something...
> BOOST_BREAKABLE
> {
> if (test1)
> {
> break;
> }
> if (test2)
>
> {
>
> break;
>
> }
>
>
> std::cout<<"this is never reached if test1==true or test2==true. "<<std::endl;
> // do something...
> }
> // here the program continues ...
>
> Is there any interest in such a library?
>
What's the difference between this and a goto? Or a do ... while(false);
loop? Both are probably shorter to write.

Sebastian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk