I always assume that 'static const' is faster than 'const', while it's actually not the case.

 

From the assembly code generated by VS 2008, 'static const' will generate a dynamic branch to make sure the variable is only initialized once. However, 'const' will generate a real constant.

 

 

相关文章:

  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2021-07-19
  • 2021-10-26
  • 2022-02-27
  • 2021-07-28
  • 2021-10-23
  • 2021-06-09
相关资源
相似解决方案