C++ treats infinite loops without side effects as undefined behavior
If your loop doesn't have an exit condition, the compiler legally has the right to completely delete it. C++ considers infinite loops without side effects as 'undefined behavior', meaning optimization engines will literally just erase your code.

Keep exploring facts in this topic.
Technology →




