This is what I would like to do:
{ ... if(condition) break; ... }
This works for a loop. I would like something similar
In C++11 the best way to achieve this is use a anonymous lambda function and replacing break with return
break
return
[&](){ ... if(condition) return; ... }();
Note that [&] captures all variables by reference, if you don't use any just replace it with []
[&]
[]