This is what I would like to do:
{
...
if(condition)
break;
...
}
This works for a loop. I would like something similar
I'm afraid I'm unleashing the wrath of a coding god against me right now, but this nice nasty macro could help people do this easier than before (based on @jleahy's answer):
//example use:
// { __breakable__
// ...
// if (condition)
// break;
// ...
// if (condition2)
// break;
// ...
// }
//WARNING: use only with a standalone block. To make if, try or catch block
// breakable use double braces
// if (cond) {{ __breakable__ ... }}
// try {{ __breakable__ ... }} catch (...) {{ __breakable__ ... }}
#define __breakable__ }switch(0){default: