I don't know for sure, but I think that you must introduce label variables.
The reason why I think that is that labeled break/continue were introduced in languages specifically to avoid providing goto, but still allow most programs to be expressed efficiently.
See this wikipedia page: https://en.wikipedia.org/wiki/Structured_program_theorem
In particular :
In 1973, S. Rao Kosaraju proved that it's possible to avoid adding additional variables in structured programming, as long as arbitrary-depth, multi-level breaks from loops are allowed
One thing that you may try: since I suppose that you are allowed to use early return statements, you can wrap any block that needs a multi-level break into its own function, and use return instead of break. Not sure about continue but probably you can figure out something.
If this is better or worse than label variables in practice I don't know
BaseClass::end()is not from one container only for sometimes.
-cc1 -triple cheerp-leaningtech-webbrowser-genericjs -emit-llvm-bc -emit-llvm-uselists -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -fno-verbose-asm -no-integrated-as -mconstructor-aliases -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fno-dwarf-directory-asm -v "-fcoverage-compilation-dir=D:\\PS4Dev\\Cheerp\\bin" -resource-dir "D:\\PS4Dev\\Cheerp\\lib\\clang\\14.0.0" -internal-isystem "D:\\PS4Dev\\Cheerp\\bin/../include/c++/v1" -internal-isystem "D:\\PS4Dev\\Cheerp\\lib\\clang\\14.0.0\\include" -internal-externc-isystem "D:\\PS4Dev\\Cheerp\\bin/../include" -internal-externc-isystem "D:\\PS4Dev\\Cheerp\\bin/../include/client" -O3 -fdeprecated-macro "-fdebug-compilation-dir=D:\\PS4Dev\\Cheerp\\bin" -ferror-limit 19 -fmessage-length=120 -fno-rtti -fgnuc-version=4.2.1 -fno-threadsafe-statics -fcolor-diagnostics -vectorize-loops -vectorize-slp -o "C:\\Users\\bingk\\AppData\\Local\\Temp\\hello-00d983.bc" -x c++ hello.cpp
Building the core compiler on Windows using Microsoft Visual Studio is fully supported, but building the base libraries (newlib, libc++, libc++abi) is not. You can grab a working copy from the latest release from any platform as they are platform independent.(same page you linked)
as specified just below: "When inserting at either end of the deque, references are not invalidated by insert and emplace." (https://en.cppreference.com/w/cpp/container/deque -> invalidation notes)
I believe deque when doing only push_backs guarantees iterators are never invalidated.
no, it says:
shrink_to_fit, clear, insert, emplace, push_front, push_back, emplace_front, emplace_back
Always invalidate iterators, In particular :
Iterator invalidation chart
When inserting at either end of the deque, references are not invalidated by insert and emplace
referencesinvalidation rule, not