4 ms·
In c++ however using goto is restricted depending on whether you'd jump over declaration of objects with non-trivial types or not.
by ensiferum 8y ago
In c++ however using goto is restricted depending on whether you'd jump over declaration of objects with non-trivial types or not.
- enriquto 8y agoof course it has to be, what would you expect it to do otherwise?
- int_19h 8y agoYou can jump past declarations if you're exiting the block - it's only a problem if you're jumping past a declaration to a point where the declared object would still be visible. But the goto equivalent of this code does not require that - it would be a jump to a label after the closing brace.