
2013/1/14 Brian Ravnsgaard Riis <brian@ravnsgaard.net>
Den Sun, 13 Jan 2013 20:30:14 +0100 skrev Vicente J. Botet Escriba < vicente.botet@wanadoo.fr>:
[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.