Boost logo

Boost :

Subject: Re: [boost] Interest in breakable labeled scope emulation?
From: TONGARI (tongari95_at_[hidden])
Date: 2013-01-13 20:50:31


2013/1/14 Brian Ravnsgaard Riis <brian_at_[hidden]>

> Den Sun, 13 Jan 2013 20:30:14 +0100 skrev Vicente J. Botet Escriba <
> vicente.botet_at_[hidden]>:
>
> [snip]
>
> Of course in order to be really structired the jumping to the underlying
>> label should be forbiden (by the compiler), but I don't think that a
>> preprocessor solution could take care of this. So the following not desired
>> and not structured code could compile even if we would like an compile
>> error.
>>
>>
>> BOOST_NAMED_BLOCK(L)
>> {
>> // ...
>> }
>> // [1]
>> //...
>> BOOST_BREAK(L); // go to [1]
>>
>
> So, the underlying idea is to get something like "break" and "continue" to
> work inside any "named" block, not just loops? If so (as you demonstrate
> above) I'm fairly certain a correct solution cannot be implemented using
> just the preprocessor.
>

Hey guys,

Please try the code attached and see the error message that your compiler
gives.
It DOES avoid the ill-formed code like that to compile.

And thanks Vicente for the elaboration.




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