[quote name='Stroppy Katamari' timestamp='1355422105' post='5010294']
[&](){ /* may return from inner loop here */ }();
I am not familiar enough with lambda expressions to know if this is cool or horrible. [/quote]It's Cornstalks' function suggestion, just replacing the function with a lambda in order to fix the (potential) issues you pointed out. Those issues are exactly the kind lambdas are intended to deal with, and thus this piece of code is totally mundane, not any sort of trickery. I'd argue it is not horrible because it is straightforward and not a hack, and it is a little bit cool because it is straightforward and not a hack.
Same natural code structure as with the goto solution, but no goto, no contrived names or messy argument lists.[/quote]
The goto solution has the same natural code as with the lambda-expression solution, but no lambda expression and no returns that don't actually return from the function.
[/quote]I'm not claiming it is massively better than the goto (if at all better), but it's obviously about as convenient, and also works for people who don't want to use goto or are prohibited from doing so.
The returns do return from the function. You are just thinking about the wrong function.