From Jason Turner
Watch on YouTube

Summary

This episode examines the safety aspects of using goto statements in C++. Jason explains that while goto is generally discouraged, the C++ compiler includes safeguards that prevent the most dangerous uses. The language forbids jumping over variable initializations and jumping between functions, making goto safer in C++ than in other languages. While emphasizing that goto is rarely the best approach, the episode demonstrates that the compiler prevents undefined behavior associated with goto's worst potential abuses.

Resources

Tags