Static Multi-level Exit

Static multi-level exit exits multiple control structures where the exit point is known at compile time.

Why?

A plain break only escapes one enclosing loop/switch. When you need to exit past several levels of nesting — and the target level is fixed in the source — you need a labelled jump. Languages without labelled break force you to use goto (which is strictly worse because the target isn’t constrained to exits).

{
    switch (...) {
        for ( . . . ) {
            ...goto BK; ...   // exit block
            ...goto SW; ...   // exit switch
            ...goto FR; ...   // exit for (or plain break)
        } FR: ;
    ...
    } SW: ;
} BK:

In uC++ / languages with labelled break (Java, etc.), prefer that over goto — the label can only target an enclosing exit, so the jump is constrained.

Tip

“Static” here means the target is known at compile time. If the exit target depends on runtime state or crosses function boundaries, you need Nonlocal Transfer instead.