且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

切换C:变量中的语句以防万一?

更新时间:2023-01-13 17:01:13

明确允许编译器使用高效的二叉树或跳转表以评估case语句。

The compiler is explicitly allowed to use an efficient binary tree or a jump table to evaluate case statements.

因此,case语句是编译时间常数。

For this reason, case statements are compile time constants.