C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A draft for modern switch

From: Zhao YunShan <dou1984_at_[hidden]>
Date: Sun, 25 May 2025 19:10:02 +0800 (CST)
The bugs caused by fallthrough are typically mistakes made only by beginners. Fallthrough is not such a significant shortcoming that requires replacing with a new keyword. If every defect in C++ keywords (like switch) were to be addressed by redefining new keywords, wouldn¡¯t the number of keywords in C++ grow endlessly over time?




For example, since C++'s try...catch... construct lacks a finally block, does this mean we need to introduce a new set of keywords.





Received on 2025-05-25 11:10:08