What does compile time 'const' mean?

后端 未结 6 1440
执笔经年
执笔经年 2020-12-10 14:49

They say the difference between readonly and const is that const is compile-time (while readonly is run time). But what exactly does that mean, The fact that it\'s compile t

6条回答
  •  臣服心动
    2020-12-10 15:13

    It just means that every instance of the member marked as const will be replaced with its value during compilation, while readonly members will be resolved at run-time.

提交回复
热议问题